Reputation: 825
I need to modify the html editor and add the silverstripe link button. I tried it with 'sslink' but this doesn't work and I can't figure out how to add this button.
That's my full code
$minimal = HtmlEditorConfig::get('minimal');
$minimal->setButtonsForLine(1, array());
$minimal->setButtonsForLine(2, array());
$minimal->setButtonsForLine(3, array());
$minimal->addButtonsToLine(1, array(
'bold',
'italic',
'underline',
'strikethrough',
'separator',
'justifyleft',
'justifycenter',
'justifyright',
'justifyfull',
'separator',
'bullist',
'numlist',
'outdent',
'indent',
'hr',
'separator',
'charmap',
'removeformat',
'separator',
'sslink',
'unlink'
));
$minimal->setOptions(array('width' => '100%', 'priority' => 1));
Upvotes: 1
Views: 285
Reputation: 2644
Am pretty sure you'll need the ss plugin too for sslink
to work:
HtmlEditorConfig::get('minimal')->enablePlugins(array(
'ssbuttons' => sprintf('../../../%s/tinymce_ssbuttons/editor_plugin_src.js', THIRDPARTY_DIR)
));
Best thing is to take example from how the cms
config is setup. Look at the file framework/admin/_config.php
this will have all you need to get stated properly.
Upvotes: 2