Custom Styles in Editor

Permalink
Trying to add custom css to the editor. I have searched, read, and come to the conclusion that I am dense or missing something. I have readhttps://documentation.concrete5.org/tutorials/adding-ckeditor-custom... with no luck.

My php experience is limited, but know some.. Theme was a html website converted to concrete5. Started with latest version. Can anyone provide an example that would work? Simplified details of how to do it? Example: I want to add the style .red to the Styles drop down in the editor. Do I need to do more than add page_theme.php to my theme.

Here is what I have in page_theme.php:

<?php
namespace Application\Theme\siriusFire;
use Concrete\Core\Page\Theme\Theme;
class PageTheme extends Theme {
public function getThemeEditorClasses()
  {
    return array(
      array('title' => t('Red'), 'element' => 'span', 'attributes' => array('class' => 'red')
     )
    );
  }
}
?>


All caching is turned off.
Core Version - 8.4.0
Version Installed - 8.4.0
PHP 7.0.30

GetSirius
 
hutman replied on at Permalink Best Answer Reply
hutman
I think you have it exactly right except for 1 thing siriusFire right in the namespace. It should be SiriusFire (assuming the theme folder is sirius_fire) and all theme directories need to be all lower case with underscores.

Once you've changed that you will likely have to clear your cache.
GetSirius replied on at Permalink Reply
GetSirius
That was it. I did not know how to write the namespace, or name my theme, properly. Renamed my theme file all lower case, used capital letters as you said, and it works!

Thank you very much!