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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Subscript and Superscript inTinyMCE


Go to End


2 Posts   3233 Views

Avatar
Steeloctopus

Community Member, 5 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, 2 Posts

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.