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

Removing elements from TinyMCE - (Resolved)


Go to End


5 Posts   3514 Views

Avatar
Crossbound

Community Member, 14 Posts

30 May 2010 at 8:27am

Edited: 31/05/2010 2:07pm

I'm trying to find out if it possible to remove elements from TinyMCE. To be exact, I am using <h1> as main heading to the website and <h2> for article headings and don't want them to be reused within articles. Is it possible to remove elements from the drop down in TinyMCE?
I have been searching the web all over and only came across some option 'invalid_elements', but I have no idea where that would be located within the TinyMCE source or if that would actually be the option to set.

Thanks for your help.

Avatar
lerni

Community Member, 81 Posts

30 May 2010 at 9:54pm

would also like to know a upgrade save way to do so. /sapphire/thirdparty/tinymce/themes/advanced/editor_template_src.js

theme_advanced_blockformats : "p,address,pre,h2,h3,h4,h5,h6",

Avatar
Crossbound

Community Member, 14 Posts

30 May 2010 at 11:18pm

Thank you lerni, that does the trick!
And you are right, an upgrade save way to do this would be great!

Avatar
lerni

Community Member, 81 Posts

31 May 2010 at 3:26am

Edited: 31/05/2010 3:30am

ahh ...

HtmlEditorConfig::get('cms')->setOption('theme_advanced_blockformats', 'p,address,pre,h2,h3,h4,h5,h6');

Avatar
Crossbound

Community Member, 14 Posts

31 May 2010 at 4:49am

brilliant!

I assume that line goes into..

/mysite/_config.php

I will try that later tonight!