7

I want to update my Rich Text field so only H1, H2 and H3 are the available options in the 'Format' selector.

Is this possible?

9

You certainly can using the Redactor Formatting config.

Locate the config file for the Redactor setting you want to edit in craft/config/redactor and add this line:

"formatting": ["h1", "h2", "h3"],

Or any combination of elements you want to be made available.

For those reading this who can't see the Formatting option for their Redactor field, it's also worth mentioning you need to have the Formatting button set up in the same config file:

"buttons": ["format"],

8

What I like to do is to override the default options of the Format dropdown by setting "formatting" to null and adding my own list of options using "formattingAdd".

This allows you to come up with your own names for the options.

{
  "buttons": ["format","bold","italic","link"],
  "formatting": null,
  "formattingAdd": {
    "h3": {
      title: 'Heading',
      args: ['h3']
    },
    "p": {
      title: 'Normal text',
      args: ['p']
    },
  }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.