Over a million developers have joined DZone.

Automatic Configuration of TinyMCE in Drupal

· Web Dev Zone

Start coding today to experience the powerful engine that drives data application’s development, brought to you in partnership with Qlik.

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 itsolved, so I contacted Boris and asked him how he configures TinyMCE.He pointed me to a Bryght install profile for Drupal that automaticallysets up various TinyMCE profiles.

While the install profile is great, I wanted to be able to tweak thesettings just a bit and be able to configure TinyMCE on existing sites.I found this GHOP project that automatically configures TinyMCEand I decided to combine Boris's settings with this. The module alsoremoves the default line break filter for the "full HTML" input filterand 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, thendisable it. I call it the "TinyMCE Automatic Profile Generator". I'mnot planning on making it a full drupal contribution, as I think it's alittle 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
  • thefont-style-select box is enabled with a "code" style - to utilizeyou'll need to define a "code" CSS class to format programming code asdesired
One the generator runs, you can always go in and tweak the settingsmanually. If you ever mess things up, run the generator again and itwill regenerate the default module settings.

Feel free to let me know of any additional configurations that you think the module should include.

Create data driven applications in Qlik’s free and easy to use coding environment, brought to you in partnership with Qlik.


Published at DZone with permission of michael anello. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}