How would YOU disable TinyMCE for a particular node type? TinyMCE's inclusion and exclusion is on a per page.
node/*
user/*
comment/*
The node type I'm trying to exclude is Webforms (which appear within "nodes" so is included in node/*). I tried using TinyMCE's "Show if the following PHP code returns TRUE" with:
<?php
if ($type == "webform") {
return FALSE;
} else {
return TRUE;
}
?>
But alas, no go -- it always considers it NOT a webform eventhough I'll view a webform (Mayhaps $type is not resolving within this tinyMCE php node context or there's another way).
Does ANYONE have an idea? Pleeeeeeeeeease... I have a community of people using my drupal site and I really really want to give them rich text features without screwing up the webforms that are heavily used as well. And I'm at a loss at this point....
Thanks!
Comments
Try use this code
Try use this
Inclusion code PARTIALLY works
Thanks, that got me thinking on using the "add" & "edit" part of the paths for inclusion. I now have it MOSTLY working as I want it with the setting "Show on only the listed pages" as:
The concept is that you ONLY want TinyMCE to show when editing & adding nodes. In this way, when people are filling out the webform, they don't see TinyMCE. Unfortunately, when "editing" a webform, you still see TinyMCE which does nothing as webform "description" and other text areas don't retain formatting, so it is misleading. But good enough to upload as most users do not edit webforms. Thanks....
crude solution to your problem
I had this problem as well and I used a combination of the above code as well as some logic in the page.tpl file to get the "editing" part disabled for certain node types as well.
In the TinyMCE visibility settings I added to
"Show on only the listed pages"
As you can see I left out the edit parts... for the "edit" pages I copied the TinyMCE JavaScript from the source of the "add" page and added the code below to the page.tpl in the head.
I know the code is probably inefficient as hell because I'm no php coder and it's late, but it works. Hopefully it helps some lost soul still on 4.7 like I am.
This will work
Use this code
I had the problem myself.
I had the problem myself. You need to load the $node to have it available in the eval. It may do query+ but hey, it's just on the add/edit page, shouldn't slow you down.
Example: Show tinymce only for story and image type.
Note that a separate code is needed in case you are adding nodes.
More general solution
This only works if you have nice URLs and no port number in your URL. The following solution is independant from the beginning of the URL:
www.pluess.li
How I disabled TinyMCE for my book(wiki) and admin pages
A bunch of other things I tried should have worked, but didn't, so I finally did this in Drupal 5:
Doug Gough
ImageX Media
What I really wanted to do
What I really wanted to do was to disable TinyMCE ONLY while adding or editing a Webform field.
The URL in these cases is in the form:
http://.../components/...
So I added in the TinyMCE this simple line:
And it seems to work.