TinyMCE:不要在工具栏上的“ styleselect”上显示h1

问题描述 投票:1回答:1

我正在使用Tinymce作为博客的编辑。我根本不使用H1来写我的博客(因为它已经预定义为静态元素),所以我想从工具栏“ styleselect(格式)>标题”中删除h1。有可能吗?

inymce.init({
    selector: '.content_textarea',
    menubar: false,     
    toolbar: 'undo redo | styleselect | bold italic | numlist bullist | link image | codesample source code | emoticons' 
});

谢谢。

tinymce
1个回答
0
投票

如果您不使用'工具栏':

tinymce.init({
  selector: 'textarea',  // change this value according to your html
    // Define your own styles
    style_formats: [
    {title: 'Heading 2', format: 'h2'},
    {title: 'Heading 3', format: 'h3'},
    {title: 'Heading 4', format: 'h4'},
    {title: 'Heading 5', format: 'h5'},
    {title: 'Heading 6', format: 'h6'},
    {title: 'Normal', block: 'div'}
    ],
});

如果使用“工具栏”:

tinymce.init({
  selector: 'textarea',  // change this value according to your html
  toolbar: 'undo redo | formatselect | bold italic | link image',
  // Define your own styles
  block_formats: 'Paragraph=p; Heading 2=h2; Heading 3=h3; Heading 4=h4; Heading 5=h5; Heading 6=h6'
});

Source

© www.soinside.com 2019 - 2024. All rights reserved.