Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to add font-size toolbar in tinyMCE?

this way i initialize tinyMCE to a textarea. font, bold italic is working but font size select is not working .

tinymce.init({     selector: "textarea#content",     theme: "modern",     width: 586,     height: 300,     menubar:false,     font_size_classes : "fontSize1, fontSize2, fontSize3, fontSize4, fontSize5, fontSize6",//i used this line for font sizes      content_css: "css/content.css",     toolbar: "sizeselect | bold italic | fontselect | fontsize",//used font size for showing font size toolbar    style_formats: [      {title: 'Bold text', inline: 'b'},             {title: 'Red text', inline: 'span', styles: {color: '#ff0000'}},             {title: 'Red header', block: 'h1', styles: {color: '#ff0000'}},             {title: 'Example 1', inline: 'span', classes: 'example1'},             {title: 'Example 2', inline: 'span', classes: 'example2'},             {title: 'Table styles'},             {title: 'Table row 1', selector: 'tr', classes: 'tablerow1'}     ], });** 
like image 327
Hasnain Avatar asked Apr 25 '13 16:04

Hasnain


People also ask

How do I change the default font size in TinyMCE?

To change the default font family, size, or color in the TinyMCE editor, we recommend using content_css or content_style (or a combination of both) depending on your use case. TinyMCE is shipped with a default CSS that determines what the font and everything else looks like in the editor itself.

How do I get rid of TinyMCE toolbar?

The Quick Insert toolbar is intended for buttons related to inserting content, but any TinyMCE toolbar buttons or custom toolbar buttons are allowed. To disable the Quick Insert toolbar, set quickbars_insert_toolbar to false .


1 Answers

All you need to do is to add fontsizeselect to your toolbar config param:

toolbar: "sizeselect | bold italic | fontselect |  fontsizeselect", 

Update:

tinymce.init({   fontsize_formats: "8pt 10pt 12pt 14pt 18pt 24pt 36pt" }); 
like image 147
Thariama Avatar answered Sep 27 '22 21:09

Thariama