Quicktags per content type
peterpoe - January 11, 2008 - 17:10
| Project: | quicktags |
| Version: | HEAD |
| Component: | Code |
| Category: | task |
| Priority: | normal |
| Assigned: | tcblack |
| Status: | patch (reviewed & tested by the community) |
Description
I needed this, so I coded it. Adds quicktags toolbar visibility per content type to admin/settings/quicktags.
| Attachment | Size |
|---|---|
| quicktags.content_types | 3 KB |

#1
This is a great idea!
Please submit a proper patch per the handbook.
#2
This was a good mod. Since it hasn't been updated, I volunteered to do.
#3
#4
testing and functioning on 5.3
#5
Applied the patch and it worked here also, ready to commit?
Jan
#6
This is a very useful but also potentially problematic code bump, I'd like to try for just a bit more feedback before committing.
#7
Will this (continue to) work for other things such as the privatemsg textarea?
Not tested, but bbcode_wysiwyg has a similar thing, and that does not. (I am using Drupal 6.x so cannot test)
#8
Tested this patch on D5.7 and it works quite well. No bugs so far. I got a drigg module installed with its special scoop content type and no problems there were with that.
#9
NBZ,
I cannot answer that (#7) question. Can anyone test it and report back here please.
#10
I have just tested this and to answer my question, it does show for privatemsg (using the default "everywhere" option - otherwise no.). Seems good to me.
#11
I've tested the patch as well and have discovered a problem when adding a content type that consists of more then one word.
For example, if the content type if "example", then it works fine. However, if the content type is "example content" then it does not.
The problem is caused by the actual URL when adding the node. When adding a node, each word in the content type is seperated with a hyphen. Whereas, in the actual content type, each word is seperated with an underscore.
This caused $type = node_get_types('type', arg(2)); in the quicktags_show_quicktags() function to not work properly.
I have fixed with this a simple string replace. Therefore, the above becomes:
$arg2 = str_replace('-','_',arg(2));
$type = node_get_types('type', $arg2);
I have edited the patch and attached. Feel free to retest.
#12
Hi!
I've tried to apply the latest patch, and the patch command ended with an error:
vermario@vermario-desktop:~/quicktags$ patch -p0 < quicktags_1.diff(Stripping trailing CRs from patch.)
patching file quicktags.module
patch unexpectedly ends in middle of line
patch: **** malformed patch at line 87:
I'm really no expert about patches, but checking documentation the command seems correct... I hope it's not my fault!
#13
Using this patch, all the custom fields created with cck have their labels and descriptions replaced with their first letters.. - A: (was author) Q: (was quote) M: L: etc.
works other than that though!
edit: same for comments - changed to C:
edit2: i solved this by changing line 178,
return theme('form_element', $element['#title'], $html, $element['#description'], $element['#id'], $element['#required'], form_get_error($element));back to
return theme('form_element', $element, $html);(from the original module)
no idea what it did, or what implications it has, or what i should do next. sorry.
but it seems to work.