Hello,

I have used FCKEditor on a number of my websites. This time after installing it I ran into an error. I am using the (Drupal 6 patch) Denver theme in Drupal 6.5.

Whenever I go to "Create Content" FCKEditor loads. When I click into the FCK text field, however, the pointer moves the center. Whenever I type something, it is centered and limited to an inch in width. I noticed that the "Center" alignment is checked by default. When I click right align, it moves about an inch to the right. When I click left align, it moves about an inch to the left. However both times it is still in the middle of the text field.

So it is stuck in Center alignment. I have re-installed FCKEditor a couple of time to try to fix it, but it never worked. Each time I load FCKEditor, the text is stuck centered. I pasted a large paragraph into it, and it reformatted it into an column in the center of the page, about an inch in width.

Hopefully someone can help. Thanks it advance.

Best Regards,
-ROR

Comments

Artur Formella’s picture

Project: FCKeditor - WYSIWYG HTML editor » Denver
Version: 6.x-2.0-alpha1 » 5.x-1.x-dev
Priority: Critical » Normal

I can confirm this bug, but FCKeditor does exactly what it's supposed to do. It loads all style sheets to improve WYSIWYG editing.
I'm moving this issue to Themes/Denver.
I set Version to 5.x because 6.x is not available

root_of_roots’s picture

I see. So it is a Denver-specific bug? Good thing I mentioned it, eh?

Regards,
-ROR

root_of_roots’s picture

Title: Text gets stuck aligned in Center - Drupal 6 » FCKEDITOR: Text gets stuck aligned in Center - Drupal 6
Priority: Normal » Critical

Anyone know of any patches or fixed for this?
Seems like it just may be a CSS glitch...

Thanks!
-ROR

dleeward’s picture

I can confirm this bug.

skstarkiller’s picture

Try this...

Go to admin/settings/fckeditor/edit/ and choose the role that you are having issues with. Edit it and choose the CSS settings. For Editor CSS choose FCKEditor Default. For Predefined styles use theme fckstyles.xml and then copy sites/all/modules/fckeditor/fckeditor/fckstyles.xml inside your theme directory (sites/all/themes/denver/fckstyles.xml).

That worked for me!

imclean’s picture

To share my experience, I had this issue with a different theme, using fckeditor with all the stylesheets including the theme's.

The theme I was working on included "text-align: center;" in the body tag. The iFrame used by fckeditor is essentially a complete page including the tag, which therefore centred everything within it.

Because the pages have at least one class in the body tag and fckeditor's body tag doesn't, to fix the problem I took the centre alignment out of body style and added it to body.class instead.

This is with Drupal 6.

dleeward’s picture

This is also happening in Tapestry theme.

ratnesh aarohi’s picture

For tapestry theme - I tried the solution given in #5 by skstarkiller
and seems to have made things fine.
here is what i did (quoted from #5)

Go to admin/settings/fckeditor/edit/ and choose the role that you are having issues with. Edit it and choose the CSS settings. For Editor CSS choose FCKEditor Default.

Will know in more detail when i use the editor extensively.

festus’s picture

The centering happens in the Tapestry theme because the body tag in style.css has:

text-align: center; /* centers container in IE 5 */

This was mentioned by #6 imclean though I'm not sure what theme he was using. The suggestion by #8 geniekids and #5 skstarkiller works for me. But, if you really want to use the "theme css" as the FCKEditor CSS, you could remove the IE 5 styles from style.css and place them in an IE-only style sheet, say IE.css. Then, you would need some conditional code in page.tpl.php to load the IE style sheet when appropriate:

<!--[if lte IE 5.5]>
      <style type="text/css" media="all">@import "<?php print base_path() . path_to_theme() ?>/IE.css";</style>
  <![endif]-->

Then as long as you aren't using IE 5.5 or earlier to create content, the text alignment should be okay.

dleeward’s picture

I tried what skstarkiller suggested in #5 and it gets rid of the default centering, but now it will not display centered text in the edit window.

Any other suggestions?

simplyrahul’s picture

The suggestion in #5 actually worked and is pretty simple.

I would definitely suggest that. And personally I do not think it may affect your theme. Other methods may affect the theme look.

Regards,
Rahul

colorado’s picture

Status: Active » Closed (works as designed)
dleeward’s picture

Can you explain your reasoning setting status to "By design"?

zlex’s picture

having the same issue. Applying the fix leads the text being forced left.

zlex’s picture

Looks like the left-align issue must be a problem with the FCKeditor css. I didn't bother to fix it, I just had it point to the Garland theme's style.css

kjshaw’s picture

This worked for me in Tapestry using theme.css. It even fixed the problem that text would not appear centered or right-justified in the editor window. I'm very happy now!:

http://drupal.org/node/432090

James T H’s picture

I had a similar issue with a customised Zen theme on Drupal 6.2. I think the problem lay with the absence of any "style.css" file, so I selected "define css" in the FCKEditor CSS settings and manually entered the CSS files I am using. The problem seems to be solved for me in this way.