Skip to content Skip to sidebar Skip to footer

How To Customize Tinymce Button Output

I would like to change the default behavior of the indent button. By default the indent button adds a css style padding-left: 30px; to the paragraph tag. I would like to change t

Solution 1:

The setting 'indentation' lets you configure the amount. The option 'indent_use_margin' was added in January 2014 to let you switch the css attribute: https://github.com/tinymce/tinymce/pull/290

I needed this because we use TinyMCE to let users edit HTML emails and email clients (esp Outlook) are notorious about spotty CSS support.

Example:

tinymce.init({indent_use_margin:true,indentation:20,

Solution 2:

I'm not sure it is possible without hacking into tinyMCE code. One option might be using custom style as shown here: http://www.tinymce.com/wiki.php/Configuration:style_formats

tinyMCE.init({
    ...
    style_formats : [
        {title : 'Indented text', inline : 'p', styles : {marginLeft : '20px'}}
    ]
});

And then apply the style instead of pressing indent button.

Post a Comment for "How To Customize Tinymce Button Output"