开发者

How do disable options from the Format menu in CKeditor?

In the Format select box, you can choose Heading 1, Heading 2 etc

How can I disable some of those options? Is it also possible to rename them? I want to only allow Heading 2 and Heading 3, and if pos开发者_C百科sible, rename them to Heading and Sub-Heading.

I figured out how to rename them - in the language file. I edited the 'en-au.js' and then set { language: 'en-au' } but it hasn't seem to have worked.


Okay, so I changed the titles under en.js, and to disable the other formats, I used this format_tags: 'p;h3;h4' in the config.


If you're using Drupal, how I ended up disabling some of the formatting options from the drop-down list was Configuration > Content Authoring > CKEditor > select profile that you want to edit > expand Advanced Options > in Custom JavaScript configuration section, add the tags you would like to have appear in your drop-down list. So, if you only need a p, h2, and h3, you would add the following script:

config.format_tags = 'p;h2;h3';

I referred to the following CKEDITOR page for syntax: http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-format_tags

Hope this helps someone

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜