Hi,
I would like to insert code snippets (e.g., Java snippets in a programming tutorial) on a SilverStripe 2.4.0 CMS --preferably without having to edit a page's HTML manually. The syntaxhl TinyMCE plugin (http://github.com/RichGuk/syntaxhl) seemed an ideal solution.
I tried installing the plugin as follows:
- downloaded the plugin code into site/cms/javascript/tinymce_syntaxhl
- edited site/cms/_config.php such that the plugin is enabled and its button is installed:
-- added HtmlEditorConfig::get('cms')->enablePlugins(array('syntaxhl' => '../../../cms/javascript/tinymce_syntaxhl/editor_plugin_src.js'));
-- added HtmlEditorConfig::get('cms')->insertButtonsAfter ('formatselect', 'syntaxhl');
-- added textarea[cols|rows|disabled|name|readonly|class] to extended_valid_elements
This does result in an extra button being shown in the editor, but the associated popup is very rudimentary. The labels of the insert and cancel buttons, for instance, are #{insert} and #{cancel}. The same goes for all other form elements (e.g. {#syntaxhl_dlg.highlight_options}).
Worse, the #{insert} button has no effect (popup does not close, nothing is inserted).
I'm guessing the problem is related to the way I installed the plugin. Any help is appreciated as I'm a complete SilverStripe newbie (until now, the default installation suited my needs perfectly).
Thanks in advance.