Domanda

I am using Silverstripe CMS and want to customize back-end wysiwyg editor Tiny MCE. I want to add into editor my custom button with my own action.

I found on TinyMCE page how to add button (http://www.tinymce.com/tryit/3_x/custom_toolbar_button.php) but I do not know where in Silverstripe folder structure can I put this javascript to extend TinyMCE.

Can you tell please me where can I put this code ?

È stato utile?

Soluzione

In your _config.php file you can alter the HtmlEditorConfig. In your mysite/_config.php (or modules _config)

$config = HtmlEditorConfig::get('cms');
$config->enablePlugins(array('pluginname' => 'plugin.js'));
$config->addButtonsToLine(2, 'pluginname'); 

A description of the plugin javascript is available at http://doc.silverstripe.org/framework/en/topics/rich-text-editing

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top