I'm trying to figure out a way to show the tinymce editor only when editing certain content types and not when editing other content types, but I can't figure out any place that I can do it. The suggested changes to theme have info about the field, but not the content type available, so I can't do any filtering by content type there. I can't figure out anything in the 'visibility' section of the profile that would allow me to show the editor based on content type. (I tried the php option hoping that $node was available, but that doesn't seem to work.) I even looked through the module itself to see if there was a way to patch it to filter by content type, but couldn't come up with anything that seems to work.

Any ideas??

Comments

karens’s picture

Figured it out myself, but thought I'd post in case others are looking. Edit the profile and go to the 'visibility' section. Select the option to show if php code returns true and enter the following code:

<?php
$exclude = array('image', 'page');
if (arg(1) == 'add' && in_array(arg(2), $exclude)) {
  return false;
} 
if (arg(0) == 'node' && is_numeric(arg(1))) {
  $node = node_load(arg(1));
  if (in_array($node->type, $exclude)) {
    return false;
  }
}
return true;
?>

The exclude array can contain a comma-separated list of content types that should not use the editor, or you can reverse the logic and put in a list of content types that *should* use the editor.

julma’s picture

Thanks I was looking for that

kreynen’s picture

Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)