hi, i have node with 2 textarea. how to disable tinymce in one of the text area?

Comments

gracearoha’s picture

Hello,

I also have this problem - specifically in my panels module.
the tinymce editor box shows up twice when i try to make custom configurations in a panel.
i only want to use full html in this area and so i added the following to the tinymce settings for visibility asking that tinymce be shown on every page except:

panels/*
'panels'
build/panels
admin/panels/*

but still the editor appears. So every time i want to edit my full html material in panels, i must disble tinymce.

Please help

edex13’s picture

kulfi’s picture

Been through that thread and similar ones, but I just can't get TinyMCE to turn off when editing Panels 2:

http://drupal.org/node/21482#comment-1046962

Any thoughts?

UPDATE, the following works for me:

function phptemplate_tinymce_theme($init, $textarea_name, $theme_name, $is_running) {

	// http://drupal.org/node/72940#comment-670728
	// enter the node types that will use TinyMCE
	$not_allowed = array('webform');

	//check for node-edit
	if (arg(0) == 'node' && is_numeric(arg(1))) {
		$node = node_load(array('nid' => arg(1)));
		if (in_array($node->type,$not_allowed)) {
			unset($init);
			return $init;
		}
	}
  
	//check for node-add
	if(arg(0) == 'node' && arg(1) == 'add') {
		if(in_array(arg(2),$not_allowed)) {
			unset($init);
			return $init;
		}
	}

	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 terms
			unset($init);
			break;
		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;
	}

	// --- handle's Panels' <textarea class="form-textarea resizable" id="edit-configuration-body" name="configuration[body]" rows="5" cols="60"> ---
	if (preg_match("/^configuration/", $textarea_name, $matches)) {
		unset($init);
	}
	
	// Always return $init
	return $init;
	
}
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.