Richtext custom field size customization

Topics: Core, General
Oct 16, 2012 at 2:04 PM

Hi,

I created a richtext custom fields, which is a nice feature.

Is there a place I can change/define it's size (specially it's height) ?

Thanks.

Alain

Oct 16, 2012 at 2:47 PM

There are two ways to change the height

  1. Using the config of the editor
  2. Overriding the css style
  3. Using JavaScript to change it

Depending on how you want to do it you have to remember that when you upgrade to a new version you have to make those changes again to what ever method you choose.

Using the config of the editor

In the file \Scripts\ckeditor\config.js it would be something like this.  Doing it this way will affect all editors for the whole project mind you.

CKEDITOR.editorConfig = function (config) {
    // Define changes to default configuration here. For example:
    config.height = '500';
};

Overriding the css style

.cke_contents {
height: 500px !important;
}

This would need to be put in the \App_Themes\Default\Default.css (however depending on the order of the css when loaded by the browser this may not work)

Using JavaScript to change it

 

CKEDITOR.replace("txtBody", 
{
      height:"500"
});

This would need to be put in a script tag on the page where the editor is rendered (IssueDetails for example or in all of the master pages)

The config option would be the ideal option.

Oct 16, 2012 at 8:17 PM

Hi,

Works fine with the CSS approach.

Thanks.

Alain.