Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to wrap the toolbar buttons to the next row in TinyMCE if the width of the editor is too small?

I am using TinyMCE in advanced theme. Today I must specify in advance the buttons in each toolbar row: theme_advanced_buttons1, theme_advanced_buttons2 and theme_advanced_buttons3.

Is there a way to just specify a single list of buttons and let the buttons wrap to the next row if the width of the editor is too small to contain them all in a single line?

like image 335
Yoni Baciu Avatar asked Jun 04 '12 23:06

Yoni Baciu


People also ask

How do I resize TinyMCE?

Clicking and dragging the resize handle in the bottom right-hand corner of the editor.

How do you style on TinyMCE editor?

Adds CSS style editing support to TinyMCE, this will enable you to edit almost any CSS style property in a visual way. You simply need to load the "style" plugin and add the control "styleprops" to any toolbar.

How do I hide the bar in TinyMCE?

Refresh you page you find close link at top-right of toolbar. Click on it . Toolbar become hidden .


3 Answers

It doesn't do it by itself, but in tinyMCE 4.X, you can add multiple toolbars like below

tinymce.init({
        selector: ".tinymce-textarea",
        theme: "modern",
        plugins: [
            "advlist autolink lists link image charmap print preview anchor",
            "searchreplace visualblocks code fullscreen textcolor emoticons",
            "insertdatetime media table contextmenu paste jbimages"//moxiemanager
        ],
        file_browser_callback: false,
        toolbar1: " bold italic | alignleft aligncenter alignright alignjustify | bullist numlist | outdent indent | link image media preview ",
        toolbar2: "forecolor backcolor emoticons | jbimages ",
        relative_urls : false

    });
like image 161
SRB Avatar answered Oct 19 '22 18:10

SRB


I'm surprised this wasn't an answer, but I just used:

.mce-btn-group .mce-btn {
    float: left;
}

I only have one toolbar, and on smaller screens it just wraps as needed.

like image 35
James Avatar answered Oct 19 '22 19:10

James


No, unfortunately, this is not possible (using Tinymce3). For Tinymce4, this is another issue.

like image 21
Thariama Avatar answered Oct 19 '22 17:10

Thariama