Anyone have any idea how I could write an extension which hooks into the “Create a New Category” form? We’re keen to give our clients a WYSIWYG editor for the Category Description field but I can’t find a way to be able to apply any modifications to this area.
Any suggestions/advice will be greatly appreciated
Ok, here’s what I figured out:
Firstly, the Create New Category form works with all your standard hooks if you access it via the Admin area. However, if you click the “Edit Categories” link that appears in the “Categories” tab on your “Publish” pages, you get a cut back version of the control panel that doesn’t allow any hooks (please correct me if I’m wrong).
It appears the reason for this is that the path is slightly different depending upon which way you want to edit your categories. Going through the Publish > Category tab will open a new window with a “Z=1” appended to the tail of the URL. Expression Engine seems to interpret any path with this query string attribute in a “SAFE MODE” type of way whereby it removes a lot of the EE admin interface and just leaves you with the necessary nuts and bolts. This is a great trick but doesn’t help me get a WYSIWYG editor on the Category Description field.
Sooooo…. I hacked up a horrible little extension that removes the Z=1 from these Publish>Category links and then hooked up LG’s WYSIWYG editor to the Category Description field. It is very crude but does the job. If you’re keen to see what I’ve come up with, feel free to download it and have a play.
Here’s the link: http://blis.net.au/downloads/ee/ext.category_wysiwyg.zip (Requires LG’s TinyMCE Extension for EE 1.6.x)
One condition before you download it though: Please don’t expect me to refine this extension further than 1.0. Expression Engine clearly didn’t intend for people to go about doing things the way this extension does it, so I’d suspect that it may not work perfectly for everyone. If you do find it helpful though, I’d love to know about it.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.