Skip to main content
  • Facebook
  • Tweet
  • Digg it
  • Stumbleupon
  • Delicious
  • Plus Share
Home
  • Home
  • Products
  • Solutions
  • Services
  • About us

Tips and tricks

Submitted by sysadmin on February 12, 2010
Printer-friendly version

When using a custom theme, sometimes it is necessary to tell FCKeditor to use the correct style. 

Let's use as an example the marinelli theme.

By default, it is hard to create a page with FCKeditor: background color used by site and font color are too similar and it's very hard to read anything, text is aligned to the center:

http://drupal.fckeditor.net/tricks

Fortunately, there is a way to tell FCKeditor to appear just like we expect.

Take a look at the source of marinelli template (you may use Firefox with Firebug to do that). The ID of main element is called "primary". The class is named "singlepage".

All we need to do is to tell FCKeditor to use that styles:

  • Edit FCKeditor profile, in the "CSS section" choose use theme css
  • In modules/fckeditor/fckeditor.config.js, add the following: 

    FCKConfig.BodyId = "primary";
    FCKConfig.BodyClass = "singlepage";

  • Now our body inside of the FCKeditor gets the right ID.
  • Well we still have the wrong background and text alignment. To fix this, add another line in fckeditor.config.js:

    FCKConfig.EditorAreaStyles = "body{background:#FFFFFF;text-align:left;}";

    in newer versions of marinelli theme we may also need to adjust the font size, so if you need to, use the following code instead:

    FCKConfig.EditorAreaStyles = "body{background:#FFFFFF;text-align:left;font-size:0.8em}";

  • Remember to clear your browser's cache after applying changes to javascript files.
  • Printer-friendly version
  • Products
  • Website Starter
  • Meeting Manager
  • Media Manager
  • Solutions
  • Corporate Website
  • Online Subscriptions, Shops and Paywalls
  • Editing and Solution Guides
  • Government Website
  • Membership Solutions
  • Government Solutions
  • Product Marketing and Campaigns
  • Services
  • Site Security
  • Site Testing
  • Content Review
  • Hosting Services
  • DevOps and System Administration
  • Custom Programming
  • Web Design Services
  • Site Monitoring
  • Copy and Technical Writing
  • About Us
  • Key Personnel
  • Contact
© 2025 MountainRiver
Powered by Drupal