How to reset applied theme editor classes

After not finding a hint on how to reset an applied theme editor class in the editor, I came up with it myself. For those asking the same question, this might be helpful.

In page_theme.php in public function getThemeEditorClasses() the first entry below provides the possibility to remove a set class by selecting “Clear” in the editor.

public function getThemeEditorClasses()
{
  return [
    ['title' => t('Clear'), 'element' => ['h1', 'h2', 'h3', 'h4', 'p'], 'attributes' => ['class' => '']],
    ['title' => t('Custom title'), 'element' => ['h1', 'h2', 'h3', 'h4'], 'attributes' => ['class' => 'custom-class']],
    ['title' => t('Another custom title'), 'element' => ['p'], 'attributes' => ['class' => 'another-custom-class']],
  ];
}

Concrete CMS version 9

1 Like

Thanks for sharing @VisualNotes!