On one content type I have 3 textareas (CCK) and I would like to have different toolbar setups on different fields.
What is the best way to achieve this?

( Is there a CCK widget, JavaScript, CSS or form_alter? I would prefer the form_alter way. )

BR,
Örjan

Comments

rhimes’s picture

subscribe

gaellafond’s picture

I have the same issue.

I don't have a real solution, just a workaround. It can be used to set two different toolbars (Advanced or Simple) for all text fields. You can than customise those two toolbars in the CKEditor config file (ckeditor.config.js).

The workaround I found is to use Force simplified toolbar feature:

  1. Go to Administer > Site configuration > CKEditor
  2. Edit the Profile to set the Advanced toolbar (you probably want to do this on all Profiles)
    1. In Editor appearance
    2. Select the toolbar you want as your Advanced toolbar (you may want to choose a Custom one defined in ckeditor.config.js): Toolbar: [CustomAdvancedToolbar]
  3. Edit the Global settings
    1. In Visibility settings
    2. Check include: Use inclusion or exclusion mode: (*) Include
    3. Add the fields name where you want to use the advanced toolbar to the textbox: Fields to exclude/include: [*.edit-body]
    4. Add the fields name where you want to use the basic toolbar to the next textbox: Force simplified toolbar on the following fields: [*.edit-signature]

Now, I have to set a 3rd toolbar for a single field. I can't find a way to achieve this.
If you find a real solution, please, post it here!

orjantorang’s picture

Thanks!
That could have worked in my case as it looked like from the beginning, with two setups. But I was afraid of there was going to be more kind of setups so it turned in to be the CSS-solution, by simply hiding the icons in the toolbar.

gaellafond’s picture

Oh! That's a nice workaround. Thanks for the tip!

jcisio’s picture

Status: Active » Closed (duplicate)

If you want 3 or more toolbars, change the css by Javascript. For example, if you don't want to show the "B" and "U" buttons on the edit-comment textarea, use this (untested) after the editor is initialized:

if ($('#edit-comment').length > 0) {
  $('.cke_button_bold').css({'display':'none'});
  $('.cke_button_underline').css({'display':'none'});
}

I'd recommend to ask the module maintainers to work for a prettier solution ;) #901502: Multi toolbar configuration, and different settings for each