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?
Craft CMS Stack Exchange is a question and answer site for administrators, end users, developers and designers for Craft CMS. It only takes a minute to sign up.
Sign up to join this communityYou 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"],
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']
},
}
}