I'm a bit frustrated by the current method that requires the TinyMCE profile and input filter to be in sync. You have to make sure the same options are specified in each, which is a hassle and can lead to subtle problems that could be tricky to diagnose. Further, you can only specify a single default filter, which often means that users will have to manually select the appropriate filter, since the default must be available to all users, and often the TinyMCE access will not be.

It would be much better if the TinyMCE module could programmatically create and apply its own input filter that corresponds to the options (i.e. buttons) that have been made available to the TinyMCE module.

Alternatively, perhaps you could specify a filter associated with a TinyMCE profile, and the buttons would automatically correspond (even if the input filer was changed). Of course, when you submit content this way, the module should be able to make the content default to the appropriate filter, rather than requiring the user to switch it over. At that point, access to the profile could simply be determined by who has access to the associated input filter.

I would prefer the former approach, but I don't know the complexitied involved in either scenario.

Comments

gracearoha’s picture

I also would be happy to see such a solution implemented but as i am not a programmer, i would have no idea how to implement.

mandclu’s picture

Here's a little something I used to accomplish this in a recent Drupal config:

function tinymce_form_alter($form_id, &$form) {
  if ($form_id == 'comment_form' || (isset($form['type']) && $form['type']['#value'] .'_node_form' == $form_id) && user_access('access tinymce')) {
    $queries = array("textarea#body", "textarea#comment");
    tinymce_add_javascript();
    
    // switch and lock the format
    if (isset($form['body_filter']['format'][3])) {
      $form['format'] = array('#type' => 'hidden', '#value' => 3);
      unset($form['body_filter']['format']);
    }
  }
}

I suppose if you wanted to tailor this to mass consumption, you could allow an admin to specify preferences for which filters to use and when, but this accomplished what I needed.

pomliane’s picture

Status: Active » Closed (won't fix)

This version of TinyMCE is not supported anymore. The issue is closed for this reason.
Please upgrade to a supported version and feel free to reopen the issue on the new version if applicable.

This issue has been automagically closed by a script.