【问题标题】:Tinymce button arangementTinymce 按键排列
【发布时间】:2015-08-29 02:44:06
【问题描述】:

以下是我的 TinyMCE 文本区域的代码,但我想将显示的按钮编辑成整齐的部分。我在下面找到了一些格式很好的代码。任何想法如何将格式(按钮分组和行)复制为以下代码。

我的代码

<?php $content = ''; $editor_id = 'txtArea'; wp_editor( $content, $editor_id, $settings = array(
       'editor_class'=>'ckeditor', 
       'media_buttons'=>false, 
       'quicktags'=>false, 
       'tinymce' => array( 
       'theme_advanced_buttons1' => ,
       'theme_advanced_buttons2' => ,
       'theme_advanced_buttons3' => ,
       'theme_advanced_buttons4' => ,

我找到的格式化代码

   { name: 'format', items : [ 'Format','Font','FontSize' ] },
    { name: 'colors', items : [ 'TextColor','BGColor' ] },
    { name: 'clipboard', items : [ 'Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo' ] },
    { name: 'editing', items : [ 'Find','Replace','-','SelectAll'] },
    { name: 'tools', items : [ 'Maximize'] },
    '/',
    { name: 'basicstyles', items : [ 'Bold','Italic','Underline','Strike','Subscript','Superscript','-','RemoveFormat' ] },
    { name: 'paragraph', items : [ 'NumberedList','BulletedList','-','Outdent','Indent','-','Blockquote','CreateDiv',
    '-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'] },
    { name: 'links', items : [ 'Link','Unlink','Anchor' ] },
    { name: 'source', items : [ 'Source'] }

提前感谢您的帮助

【问题讨论】:

    标签: wordpress tinymce textarea


    【解决方案1】:

    我想我找到了自己的答案,因为它似乎有效

        <?php $content = ''; $editor_id = 'txtArea'; wp_editor( $content, $editor_id, $settings = array(
           'editor_class'=>'ckeditor', 
           'media_buttons'=>false, 
           'quicktags'=>false, 
           //'tinymce' => array( 
           //'theme_advanced_buttons1' =>'' ,
           //'theme_advanced_buttons2' =>'' ,
           //'theme_advanced_buttons3' =>'' ,
           //'theme_advanced_buttons4' =>'')
            ));?>
            <script>
            CKEDITOR.replace('txtArea', {toolbar:'Standard'});
            CKEDITOR.editorConfig = function( config ) {    
        config.toolbar_Standard = [
            { name: 'format', items : [ 'Format','Font','FontSize' ] },
            { name: 'colors', items : [ 'TextColor','BGColor' ] },
            { name: 'clipboard', items : [ 'Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo' ] },
            { name: 'editing', items : [ 'Find','Replace','-','SelectAll'] },
            { name: 'tools', items : [ 'Maximize'] },
            '/',
            { name: 'basicstyles', items : [ 'Bold','Italic','Underline','Strike','Subscript','Superscript','-','RemoveFormat' ] },
            { name: 'paragraph', items : [ 'NumberedList','BulletedList','-','Outdent','Indent','-','Blockquote','CreateDiv',
            '-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'] },
            { name: 'links', items : [ 'Link','Unlink','Anchor' ] },
            { name: 'source', items : [ 'Source'] }
        ];
    
    };
            </script>
    

    它可能不是世界上最漂亮的代码,但只要它有效:)

    【讨论】:

      猜你喜欢
      • 2021-09-12
      • 2020-09-24
      • 1970-01-01
      • 2020-05-28
      • 1970-01-01
      • 1970-01-01
      • 2016-08-31
      • 1970-01-01
      • 2019-01-30
      相关资源
      最近更新 更多