Automatic Configuration of TinyMCE in Drupal
At Drupalcon Boston I was in a session that Boris Mann of Raincity Studios was giving and he made a throwaway comment about how TinyMCE doesn't actually suck - if you know how to configure it correctly.
Well, I always thought it sucked and caused more problems than it solved, so I contacted Boris and asked him how he configures TinyMCE. He pointed me to a Bryght install profile for Drupal that automatically sets up various TinyMCE profiles.
While the install profile is great, I wanted to be able to tweak the settings just a bit and be able to configure TinyMCE on existing sites. I found this GHOP project that automatically configures TinyMCE and I decided to combine Boris's settings with this. The module also removes the default line break filter for the "full HTML" input filter and expands the allowed tags for the "filtered HTML" input filter.
The result is a module that you can add to your site, run it once, then disable it. I call it the "TinyMCE Automatic Profile Generator". I'm not planning on making it a full drupal contribution, as I think it's a little too specialized, but you can download it here if you'd like.
Once you run it, be sure to:
- Give the proper roles "access TinyMCE" permissions on admin/user/access
- Assign roles to each profile on admin/settings/tinymce
In addition to three Bryght profiles (Comments, Basic, Advanced), I added the following:
- the default image button is enabled for the Advanced Profile
- the font-style-select box is enabled with a "code" style - to utilize you'll need to define a "code" CSS class to format programming code as desired
One the generator runs, you can always go in and tweak the settings manually. If you ever mess things up, run the generator again and it will regenerate the default module settings.
Feel free to let me know of any additional configurations that you think the module should include.