Skip to content

Creating a new plugin

Cliff Parnitzky edited this page May 4, 2015 · 4 revisions

Adding a simple plugin

Add the following code to TinyMceMyPlugin/config/config.php:

$GLOBALS['TINY_PLUGINS'][] = 'myplugin';

Adding a plugin with a button

Add the following code to TinyMceMyPlugin/config/config.php:

$GLOBALS['TINY_PLUGINS'][] = 'myplugin';

$GLOBALS['TINY_BUTTONS_1'][] = 'myplugin | ';

($GLOBALS['TINY_BUTTONS_2'] or $GLOBALS['TINY_BUTTONS_3'] could also be used) (buttons will always be added to the end of a button bar)

Adding a plugin with complex config

Implement HOOK: editTinyMcePluginLoaderConfig

Add the following code to TinyMceMyPlugin/config/config.php:

$GLOBALS['TL_HOOKS']['editTinyMcePluginLoaderConfig'][] = array('TinyMceMyPluginClass', 'myEditTinyMcePluginLoaderConfig');

Add the following code to TinyMceMyPlugin/TinyMceMyPluginClass.php:

public function myEditTinyMcePluginLoaderConfig ($arrTinyConfig) {
	// edit the config here
	// e.g. add additional config rows
	// e.g. modify existing rows
	// e.g. remove rows

	return $arrTinyConfig;
}

Clone this wiki locally