0
votes

Can anyone tell me how I restrict the editor to only allow h1 and h2 under the Format attribute in the CKEditor:

CKEDITOR_SETTINGS_TITLE = {
    'language': '{{ language }}',
    'toolbar_HTMLField': [
        ['Format']
    ]
}
1
Make extra toolbar with custom name in settings.py and add only needed plugins - Neeraj Kumar

1 Answers

2
votes

Add the format_tags option to select the formats available in CKEditor:

CKEDITOR_SETTINGS_TITLE = {
    'language': '{{ language }}',
    'toolbar_HTMLField': [
        ['Format']
    ],
    'format_tags': 'h1;h2'
}