Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Customising the CMS /

Subscript and Superscript inTinyMCE


Reply


2 Posts   518 Views

Avatar
Steeloctopus

Community Member, 4 Posts

14 April 2014 at 5:23pm

Hi I have an out-of-the-box Silverstripe installation and I want to display subscript and superscript buttons on the tinyMCE control.

Unfortunately I can't get the buttons to display not matter what I try. They are definitely supported in tinyMCE but for some reason these buttons have been remove from the default installation and are not showing up on the Silverstripe tinyMCE instance.

Can any body tell me why these are not there and what I can do to display these controls.

Thanks

Avatar
RyanTanger

Community Member, 1 Post

19 June 2014 at 5:07pm

Hey Steeloctopus,

In order to add the buttons to the TinyMCE bar, add this code to your _config.php:

HtmlEditorConfig::get('cms')->addButtonsToLine(2, 'sub', 'sup', 'separator');

This results in the Subscript and Superscript html elements ('sub' and 'script' arguments relatively) being added to the second line of the bar, and then adds a separator. I'm not 100% as to whether this works with SS < 3.1.x, as I've only used it on that.