Login

Username

Password





Register   Reset password

This is a read-only archive of the forum.

# klim 3/20/2010 6:31 PM
Hello everyone!

I´ve build a site, and it's almost done, but I ran in to some problems. The text doesnt look similar on all the pages, the background color arent the right, on some sites its half the text that got the right color and the rest dont. The text arent placed right, its like the padding or margin has changed. I have tried to look for the files where the text are stored, but cant find it anywhere. Are the content stored in the DB ?

The only page who has the right background color and the text are placed right, are home.aspx.

I hope anyone, can help me figure this out.

//Klim
# Constructor 3/20/2010 7:31 PM
I am unsure as to what the problem is exactly.

You state "The text doesnt look similar on all the pages..." but is this when you are editing the text? Try explaining click by click.
# klim 3/20/2010 8:43 PM
Well, Im logging in as admin user from the box on the right of the page.

When Im logged in, the edit buttons appears as normal. I click the edit button, in the main content which is the static html module. I enters the other page where you edit from, and type in the text.

The strange thing is that the text on the home page are with the grey background as I want it, but when I add some new the background turs white. So my question realy is where do I control this background color?

//Klim
# Constructor 3/20/2010 9:26 PM (edited 3/20/2010 9:30 PM)
When you edit the content of a Static HTML section, the stylesheet that is applied to your site is not applied to the editor. So the text would appear larger and black (usually). When you save any changes and go back to your site, the content you have just entered would be subject to the site template CSS. Any styles that alter the way this content is rendered would be applied.

I made changes to my own Cuyahoga site template specification so that it requires a second CSS file (that is essentially a copy of the main site template CSS with some structural styles removed) and prepend 'editor_' to the file name. This is then picked up by the editor and used to style the content when editing. This give a more consistent view of the content both admin and public. I do this by adding to the FCK Editor instance as such:
//To DISPLAY template styles in editor
fckEditor.EditorAreaCSS = UrlHelper.GetApplicationPath() + this.Node.Template.BasePath + "/css/editor_" + this.Node.Template.Css;

//To ADD template styles in editor DropDown List
fckEditor.StylesXmlPath = UrlHelper.GetApplicationPath() + this.Node.Template.BasePath + "/css/fckstyles.xml";

As you can see, I also added fckstyles.xml to add the site template classes to the FCK Editor CSS class drop down. This enables the application of site template styles in the FCK Editor. It all works well if you take care to remove structural classes from the editor css.

In short, your content will look different in the editor than it does on the site because the site template CSS is not applied in the editor in V1.6.

That is if I have understood you correctly.
# klim 3/21/2010 3:00 PM
Im not sure you understand what the problem is, or maybe its just me not understanding your code, and how it should solve the problem

I´ve uploaded some pictures that illustrates whats wrong. Picture 1, the top text is how I want the text to look like, besides the first arrow i draw. The second arrow is what happens when I edit and add some more text

The second picture show how the other sites look like

Picture 1
http://kl1m.dk/stuff/ss1.jpg

Picture2
http://kl1m.dk/stuff/ss2.jpg

//Klim
# Constructor 3/21/2010 5:03 PM
klimIm not sure you understand what the problem is, or maybe its just me not understanding your code, and how it should solve the problem

I´ve uploaded some pictures that illustrates whats wrong. Picture 1, the top text is how I want the text to look like, besides the first arrow i draw. The second arrow is what happens when I edit and add some more text

The second picture show how the other sites look like

Picture 1
http://kl1m.dk/stuff/ss1.jpg

Picture2
http://kl1m.dk/stuff/ss2.jpg

//Klim

This looks like a simple CSS issue. Use FireBug to examine what styles are being applied. All will become clear if you are familiar with CSS and how it is applied to HTML.

If the site is hosted anywhere then post the URL and I can tell you what is going on.
# klim 3/21/2010 6:13 PM (edited 3/21/2010 6:17 PM)
Well the firebug help me almost figure the problem out. The editor creates a span withing this span there is a div box.
The div box has following stylecode: background-color: rgb(255, 255, 255); padding: 5px; margin: 0px; font-family: Arial,Verdana,sans-serif; font-size: 12px;

The spans class is Apple-style-span, and I wrote in the css of my template following code:

.Apple-style-span div p {
background-color: #efefef;
margin: 0;
padding: 0;
}

The strange thing is, that the paragraph is chaning it´s background color, but the div box dont. Am I doing the css code wrong, or do you know a way to fix this?

//Klim
# Constructor 3/21/2010 6:44 PM
In FireBug you can check what styles are being applied to a selected element. It will list the applied CSS classes and also the CSS filename in which they reside in the 'Style' panel to the lower right (when an element is seleted).

An unwanted style is being inherited somewhere. Seek and ye shall find... :)
# klim 3/21/2010 7:01 PM (edited 3/21/2010 7:20 PM)
I have found the div box the text is getting it´s style from

I couldnt paste the code in here, for some reason it caused errors. So I uploaded a rtf document even with colors in the code :P

http://www.kl1m.dk/stuff/code_maincontent.rtf

This must be something the editor gives the paragraphs and div boxes it creates in the maincontent placeholder.

//Klim
# Constructor 3/21/2010 7:44 PM (edited 3/21/2010 9:01 PM)
Your code has inline styles AND classes.
< span style="font-family: 'Times New Roman'; line-height: normal; font-size: medium;" class="Apple-style-span"> something here < /span>

Also there seems to be a lot of markup that is not required. Create your site styles in CSS and apply those using classes or other selector. Like this:
< span class="Apple-style-span"> something here < /span>

If the class styles are not there when you view the site they are being overwridden by inline styles you apply in the editor/admin. Look into how CSS works with HTML.

Also, if you paste content from another website or a Word document then the styles will be paste along with the content unless you clean it first. Use the code view in the editors to help see what is there. Try to use code view and get comfortable with CSS and HTML.
# klim 3/22/2010 8:25 AM
I´ve worked with html and css for some time now and know how it works. The one thing is, the class and the styles are not something I have added. Some C# script or something must create the class somewhere, and put on the styles for the box.

But I will try to add a specific stylesheet for the editor module in its own folder.
# Constructor 3/22/2010 10:41 AM (edited 3/22/2010 11:01 AM)
klimI´ve worked with html and css for some time now and know how it works. The one thing is, the class and the styles are not something I have added. Some C# script or something must create the class somewhere, and put on the styles for the box.

But I will try to add a specific stylesheet for the editor module in its own folder.

After Google search on 'Apple-style-span' I found: http://dev.fckeditor.net/ticket/55

Looks like an old FCK Editor issue. I have never had this. I added the latest FCK to by build.

What version Cuyahoga you using?
What browser and OS?

If you paste from another document/website or application you will paste styles with it (Like when you copy-past some text from adobe InDesign).

'Paste as plain text' or 'Paste from word' exists to clean this up.
# klim 3/22/2010 1:09 PM
That was the problem! Great!

Im using cuyahoga 1.6 and running it on windows server 2003 r2 through visual studio. The problem appears in all browsers.

But it worked copy paste it into notepad to remove the formating.
# Constructor 3/22/2010 1:42 PM
I did say that yesterday (see above Posted: 21 March 2010 10:44:44)
Also, if you paste content from another website or a Word document then the styles will be paste along with the content unless you clean it first.

At least you know now. :)