Insert this code into your template.php in your theme and you gain control over which fields are editable using TINYMCE
function phptemplate_tinymce_theme($init, $textarea_name, $theme_name, $is_running) {
switch ($textarea_name) {
// Disable tinymce for these textareas
case 'log': // book and page log
case 'img_assist_pages':
case 'caption': // signature
case 'pages':
case 'access_pages': //TinyMCE profile settings.
case 'user_mail_welcome_body': // user config settings
case 'user_mail_approval_body': // user config settings
case 'user_mail_pass_body': // user config settings
case 'synonyms': // taxonomy terms
//case 'description': // taxonomy description **** THIS ELEMENT IS THE ONE WHICH STOPS THE DESCRIPTION FROM BEING TINY MCE, COMMENT IT OUT *****
unset($init);
break;
// Force the 'simple' theme for some of the smaller textareas.
case 'signature':
case 'site_mission':
case 'site_footer':
case 'site_offline_message':
case 'page_help':
case 'user_registration_help':
case 'user_picture_guidelines':
$init['theme'] = 'simple';
foreach ($init as $k => $v) {
if (strstr($k, 'theme_advanced_')) unset($init[$k]);
}
break;
}
/* Example, add some extra features when using the advanced theme.
// If $init is available, we can extend it
if (isset($init)) {
switch ($theme_name) {
case 'advanced':
$init['extended_valid_elements'] = array('a[href|target|name|title|onclick]');
break;
}
}
*/
// Always return $init
return $init;
}
Bookmark/Search this post with:
Comments
Brevity
Here's a slightly less long-winded and more futureproof way of doing the same thing:
function phptemplate_tinymce_theme($init, $textarea_name, $theme_name, $is_running) {if ($textarea_name == 'relatedlinks-fieldset-relatedlinks') unset($init);
else $init = theme_tinymce_theme($init, $textarea_name, $theme_name, $is_running);
// Always return $init
return $init;
}
Instead of replicating the whole function and making a small change, I've specified an action for a particular instance and told it to use the standard theme_tinymce_theme() function in all other cases.
Note that this usually requires some investigation into what exactly is supposed to be returned by the theme function, so you can catch it and throw it back.