Hi,

I have a number of text fields defined in a CCK page, but TinyMCE only displays on the "body" element. How do I get it to display on the rest of them?

Comments

jsenich’s picture

TinyMCE will only appear on textarea (multi-line text) fields that have the "Text processing" parameter set to "Filtered text". It will not appear on Plain text fields.

tkgafs’s picture

I am using garland theme and have created a cck content type which has a couple of text fields which are multiline and set to filtered text, but tinymce still does not appear.

If i follow the advice given in the other page mentioned in this post do I have to add the names of the fields to the the theme_tinymce function ?

or am i simply missing something really simple ?

Tkgafs

littleprince’s picture

I'm new Drupal, Need to get a project done ASAP.

I opened the tinymce.module file and on line 103 (for me anyways)
changed if ($editor_element==0) {$tinymce_elements = 'edit-body,edit-field-body-0-value';}
since edit-field-body-0-value was the new field I created in CCK that I wanted TinyMCE to show up on.

I suppose you could just take out the if/elseif/else and just assign $tinymce_elements to the ones you want.

Of course this is only a very temporary fix. I would fix the module, but I'm new to Drupal, and still learnign the API, all the hooks and how data gets moved around. If this is not fixed later and I have time I'll do a proper fix. Just currently busy.

Mike

open-keywords’s picture

and thus the ability to select input filters

but no, it doesn't disable TinyMCE on these fields

markhope’s picture

Similar post here, which should answer your question:
http://drupal.org/node/72940

M

ray007’s picture

In the times of drupal 4, tinyMCE was showing up on too many pages.
Now, with drupal 5, the settings are a lot less configureable, and the tiny-editor per default activates only on body-fields, which IMHO is a bad idea.
I'd wish for some easy settings to allow tinymce on cck text-fields with multiple lines, comments, ... too.

tkgafs’s picture

the tiny-editor per default activates only on body-fields,

so what do you need to do to make it available on other text fields ?

tkgafs

tkgafs’s picture

it might be helpful to know that if you leave the body field turned on in a cck content-type

you can print it out using print $node->content['body']['#value'] in your node-content_xxxxx.tpl.php file

tkgafs

chrishieronymus’s picture

OK, I went to the post cited above (http://drupal.org/node/72940), played around with the code a bit, and I think I can now turn off tinyMCE in fields where it would otherwise appear. But I (and I think others as well) are having the opposite problem: how to turn on tinyMCE in cck fields.

Has anybody figured this out? One of the posts suggests hacking the tinymce.module. How do I know the name of the cck field so I can enable it? I have a field that I called "schedule", in the mysql database I can see it as "field_schedule_value"; but if I test for this in the tinymce.module it doesn't get used.

chrishieronymus’s picture

After conferring with "littleprince", I finally got the abovementioned hack working. For anyone else trying to do the same, here's what I just learned.

1) Hack the tinymce.module file as described by "littleprince". You get the name of the field by looking at the html-source that your browser displays (when you go to "add content" -> "your cck content type"). If the field name you entered in cck is "schedule", the name to add in line 103 of tinymce.module is "edit-field-schedule-0-value".

2) Add the field type to your tinyMCE settings. If you called the content type "course", add course to "Enable tinyMCE for these node types:". That type is also displayed in the URL when you add content. In my case, it's somewhere.com/drupal/?q=node/add/course.

3) Be sure the type described in point 2 does not contain any "-" (not sure about other special characters). This seemed to screw things up for me.