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 the entire 3rd row on default Content TinyMCE


Go to End


4 Posts   1160 Views

Avatar
neilcreagh

Community Member, 136 Posts

17 March 2017 at 4:21am

Edited: 17/03/2017 4:23am

I can customise the buttons that appear in each row of TinyMCE and even remove the Table controls using the code below but the third row still appears with just separators in it. Is there any way to remove these separators and remove this 3rd row completely?

HtmlEditorConfig::get('cms')->setOption('theme_advanced_blockformats', 'p,h1,h2,h3');
HtmlEditorConfig::get('cms')->setOption('theme_advanced_disable', 'styleselect,cut,copy,paste,pasteword,undo,redo,selectall,visualaid,separator,Separator,|');
HtmlEditorConfig::get('cms')->setButtonsForLine(3);
HtmlEditorConfig::get('cms')->disablePlugins('table');

This results in:

I would love to get rid of that last row!
(using CMS and Framework 3.5.2)

Avatar
Devlin

Community Member, 344 Posts

18 March 2017 at 5:24am

HtmlEditorConfig::get('cms')->setButtonsForLine(3, '');

Avatar
neilcreagh

Community Member, 136 Posts

19 March 2017 at 12:00am

Thanks Devlin, but I already tried that (just tried again to confirm) it makes no difference - I still have that third row with separators in it.
I also tried ->setButtonsForLine(3, array()); but no joy
Any other ideas?

Avatar
neilcreagh

Community Member, 136 Posts

19 March 2017 at 12:10am

I solved this by adding the following CSS to my cms.css file in mysite/extracss folder

 .mceToolbarRow3 { display: none;} 

It's a bit of a hack, but it works.

If anyone is interested here are the other items I've got in this extra css file that I find useful:

/* Hide ErrorPages from CMS */
li.class-ErrorPage {
	display: none !important;
}

/* Gray out Pages hidden from menus */
.notinmenu > a {
	color: #89878b !important;
}

/* Fixes extra margin on HTMLEditor Right Title labels */
.htmleditor.field label.right {
	margin-left: 0;
}

/* Aligns UploadField with other normal fields! */
.ss-uploadfield .middleColumn {
	float: left !important;
	clear: none !important;
}

/* Hides Pages that can't be created in Add page list */
#Form_AddForm_PageType li.disabled { 
    display: none !important;
}

/* Float Gridfield 'Add New' button to the right */
.ss-gridfield > div.ss-gridfield-buttonrow-before {
	float: right;
}

/* Hide TinyMCE HTMLEditor third row of buttons */
.mceToolbarRow3 { display: none;}

Some of these might already be addressed in 4.0 but I find the CMS experience better with these updates