【问题标题】:Drupal custom module, turn tinymce off programatically?Drupal自定义模块,以编程方式关闭tinymce?
【发布时间】:2011-05-21 20:33:27
【问题描述】:

在 Drupal 中,在自定义模块中的 textarea 上,如何以编程方式关闭 tinymce 编辑器 (tinytinymce)?

  $form['subject'] = array(
    '#type' => 'textfield',
    '#title' => t('Please Enter Subject'),
    '#required' => TRUE,
    '#weight' => 5, 
    '#description' => t('some description'), 
 '#suffix' => 'a suffix',  
  );

【问题讨论】:

    标签: drupal tinymce textarea


    【解决方案1】:

    我将以下内容用于 cmets。你应该能够适应你的形式。

    function MYMODULE_form_alter (&$form, &$form_state, $form_id)
    {
            if ($form['#id'] == 'comment-form') {
                    $form['comment_filter']['format'] = array(); // nuke wysiwyg from comments
            }
    }
    

    【讨论】:

      【解决方案2】:

      试试

      tinyMCE.execCommand('mceRemoveControl', false, editor_id); // the editor_id equals the id of your textarea
      

      【讨论】:

      • @Aalok Parish:这不是评论,而是提问者问题的解决方案!
      猜你喜欢
      • 1970-01-01
      • 2015-10-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-03-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多