Trying to add a button to the editor for an hr
element.
So I added to my _config.php file:
use SilverStripe\Forms\HTMLEditor\HtmlEditorConfig;
HtmlEditorConfig::get('cms')->insertButtonsAfter('underline', 'hr');
Did a dev/build flush muck around and no change.
I dumped the value of HtmlEditorConfig::get('cms')->getButtons();
and there is no hr
in there.
When I check the value of HTMLEditorConfig::get_active_identifier();
it is “default” not “cms”.
So changed it to: HtmlEditorConfig::get('default')->insertButtonsAfter('underline', 'hr');
flush etc and no change again.
I had a look in vendor/silverstripe/admin/_config.php.
and in there they are working with an instance of SilverStripe\Forms\HTMLEditor\TinyMCEConfig;
It’s probably an alias but I changed it anyway:
use SilverStripe\Forms\HTMLEditor\TinyMCEConfig;
TinyMCEConfig::get('cms')->insertButtonsAfter('underline', 'hr');
# and also tried
TinyMCEConfig::get('default')->insertButtonsAfter('underline', 'hr');
and still no hr button.
hr
is in the valid_elements array too. Like this: hr[class],
So how the … can I add this button?!