How to use GenericSetup to export and import TinyMCE settings for a Plone site
Purpose
The default settings of products specified in the Control Panel usually are good enough for most website. But when you are building a Plone theme which needs custom settings you don't want to select all those settings for every website you're using the theme for. This howto will show you how you can export the current settings of a website and reuse those settings in a Plone theme using a GenericSetup profile.
Prerequisities
This howto assumes you have basic knowledge of theming and customizing a Plone site.
Step by step
First step is to go to the TinyMCE Control Panel. There you will select all the settings you want for your Plone theme.
Next go to the ZMI and go to portal_setup of your Plone Site. In Portal Setup select the Export tab. This should look something like:
Now select the checkbox before TinyMCE Settings and press the "Export selected steps" button on the bottom of the screen. This will let you download a file called setup_tool-xxxxxxxxxxxxxx.tar.gz. Within this archive is a tinymce.xml file with all the settings you previously selected.
The last step is to copy the tinymce.xml file to the profiles/default directory of your Plone theme. Now everytime your Plone will be applied to a Plone Site all the settings from the tinymce.xml file will be applied also.
When you want to change the settings you can repeat the above steps to create a new tinymce.xml file or simply edit the tinymce.xml file if you are familier with xml.
Advanced usage
When following the above steps all the TinyMCE settings will be replaced by the settings in the tinymce.xml file. GenericSetup also has the option to add settings without purging all the other settings. This can be done by setting the purge attribute of an xml tag to false.
If we want for example only add some styles to the style menu and leave all the other settings alone we can use the following tinymce.xml file:
<?xml version="1.0"?> <object> <layout> <styles purge="False"> <element value="Contact Information|div|contactInformation discreet"/> <element value="Notes to editors|div|notesToEditors"/> </styles> </layout> </object>
Further information
More information about GenericSetup can be found in the tutorial Understanding and Using GenericSetup in Plone.
