Closed (fixed)
Project:
Tiny Tiny MCE
Version:
6.x-1.10
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
3 Nov 2008 at 18:37 UTC
Updated:
2 Dec 2008 at 16:41 UTC
I understand how to exclude text area, but am using a new module called album photos. The description for each photo is a uniquely numbered text field. How in the world can I turn off the editor in this instance? Thanks! :)
Comments
Comment #1
Steve Lockwood commentedI might have to make a change to the software - maybe include a wildcard such as nodename_* to exclude.
For the textfields you want to exclude, how could the module identify them?
Comment #2
Starminder commentedApparently the author uses FCK, which allows to add wildcards for exclude lists
node/*/photos
photos/admin
by specifying in this manner, it turns the editor off for all these locations. Seems to be the same syntax to turn off a block on certain pages, etc.
The text fields are currently named in this manner: edit-photos-###-des, where ### is a unique number based on the number assigned to an uploaded photo. I of course tried a wildcard in place of the ###'s but as you already know it was to no avail :)
Thanks for your help, TTM rocks.
Comment #3
Steve Lockwood commentedI have nearly finished working on a new version which should do what you need.
At the moment you can specify which text areas can be turned off - but they have to be explicitly named.
The new version will have two new features:
- specify text areas to be turned off using regular expressions, so you could specify something like /photos/
- switch which textareas are to be turned on
I will do a proper release in the next few days - but you are welcome to try the development snapshot
Steve
Comment #4
Starminder commentedI'm likely not expressing the exclusions correctly: I've tried these so far to no avail:
(appending to the existing one's) edit-synonyms, edit-description, edit-url, edit-des, /node/*/photos/, /photos/admin/,/photos/, edit-photos-*-des
I'm out of ideas, hope it's something obvious I am missing - thanks!
Comment #5
Steve Lockwood commentedRegular expressions are quite tricky - try this:
To use regular expressions we need to convert the original list to a regular expression:
Now we could add an expression which matches the id of your photos
I have added "^edit-photos-.*-des$" on the end. This breaks down into:
^edit-photos- (must begin with "edit-photos-")
.* (can have anything in the middle)
-des$ (must end with "-des")
I hope this helps. Don't forget that you are matching on the id of the textarea, not the Drupal path, so /node... etc will not work. To find out the id of the textarea you can either examine the HTML source or you can switch on the "show textarea ids" option in admin/settings/tinytinymce.
If you want to try out regular expressions, I have created a test tool at http://stevelockwood.net/regular-expressions. Here you can type in a regular expression and test it against any string that you enter. there are also a couple of useful links there.
Comment #6
Starminder commentedI replaced the test areas listed with the revised regular expressions above:
Am getting this:
* warning: preg_match() [function.preg-match]: Unknown modifier ' ' in /usr/home/hoslo/public_html/sites/all/modules/tinytinymce/tinytinymce.module on line 155.
* warning: preg_match() [function.preg-match]: Unknown modifier ' ' in /usr/home/hoslo/public_html/sites/all/modules/tinytinymce/tinytinymce.module on line 155.
* warning: preg_match() [function.preg-match]: Unknown modifier ' ' in /usr/home/hoslo/public_html/sites/all/modules/tinytinymce/tinytinymce.module on line 155.
* warning: preg_match() [function.preg-match]: Unknown modifier ' ' in /usr/home/hoslo/public_html/sites/all/modules/tinytinymce/tinytinymce.module on line 155.
and the editor still shows up on the photo fields.
Comment #7
Steve Lockwood commentedAny space after the regular expression will "break" it - I will do an update to the module which prevents this but in the meantime you can fix this by making sure that there no white space (such as spaces or newlines) after the regular expression. So "^edit-photos-.*-des$/" should be the very last thing in the text box.
Comment #8
Starminder commentedHere's what I have:
/^edit-teaser-js|edit-code$|^edit-log$|^edit-img_assist_pages$|^edit-caption$|^edit-pages$|^edit-access_pages$|^edit-user_mail_welcome_body$|^edit-user_mail_approval_body$|^edit-user_mail_pass_body$|^edit-synonyms$|^edit-description$|^edit-photos-.*-des$|^edit-url$/Is it the missing $ after ^edit-teaser-js doing it or the missing ^ in front of edit-code$ ? I copied from above ;)
Here's what I have now:
/^edit-teaser-js$|^edit-code$|^edit-log$|^edit-img_assist_pages$|^edit-caption$|^edit-pages$|^edit-access_pages$|^edit-user_mail_welcome_body$|^edit-user_mail_approval_body$|^edit-user_mail_pass_body$|^edit-synonyms$|^edit-description$|^edit-photos-.*-des$|^edit-url$/Still getting the error.
Comment #9
Steve Lockwood commentedYou are quite right - the first part should read /^edit-teaser-js$|^edit-code$
However, that would not cause the program error. Any additional characters after the closing / will cause the problem, though.
Comment #10
Starminder commentedYep, I had a trailing
<return>. Got rid of it and so far all is well, and the editor is now detached from the desired text fields. Thank you thank you thank you.Comment #11
Starminder commentedUpdating status, thanks again!