TinyMCE:在工具栏的“样式选择”中不要显示h1

4
我正在使用Tinymce作为博客编辑器。我不使用H1来写博客(因为它已经被预定义为静态元素),所以我想从工具栏“样式选择(格式)>标题”中删除h1。这可行吗?
inymce.init({
    selector: '.content_textarea',
    menubar: false,     
    toolbar: 'undo redo | styleselect | bold italic | numlist bullist | link image | codesample source code | emoticons' 
});

感谢。
1个回答

4
如果您没有使用“工具栏”:
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'
});

来源


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接