Search code examples
djangockeditordjango-cms

Django CMS CKeditor


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']
    ]
}

Solution

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

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