Undistraction
Undistraction

Reputation: 43351

Can The Labels On CKEditor's Toolbar Items Be Changed?

I am intialising CKEditor like this:

  function init() {
    $( ".ckeditor" ).ckeditor( {
      format_tags: 'h3;p',
      toolbar: [
        [ "Source", "-", "Bold", "Italic" ],
        [ "Link", "Unlink" ],
        [ "Blockquote", "Format" ]
      ]
    } );
  };

The line:

format_tags: 'h3;p'

… tells CKEditor to only place options for h3 and paragraph tags in the format menu. This works fine, however I would like the h4 Header item to be labeled simply Title.

How can I customise the label of this item?

Upvotes: 0

Views: 160

Answers (2)

Matty Balaam
Matty Balaam

Reputation: 1309

I've been trying to find a good way to do this. The best I have come up with is waiting for the 'instanceReady' event, and then overwriting properties, example code:

CKEDITOR.on('instanceReady', function(){
  CKEDITOR.lang['en-gb'].common.browseServer = 'custom browser label';
  CKEDITOR.lang['en-gb'].image.btnUpload = 'custom browser label';  
});

Note I am only targeting 'en-gb' in this example - you will need to target your own language. If CKEDITOR is using a different language file this method in untested and may break.

Upvotes: 0

Andrew Kirk
Andrew Kirk

Reputation: 1869

One would think there would be a way to change the label via a the format_h4 config parameter, however, I've not been able to find the write parameter name to do so.

The only way I've found to change the label is via the language file. For example, if the default language has not been changed, look for "tag_h4" in lang/en.js and change the label associated with it.

Upvotes: 1

Related Questions