I've been trying to figure this one out for a while but finally managed to get something working.
Templates in TinyMCE.
1. First, you need to enable the templates plugin in the TinyMCE module configuration (Extensions > TinyMCE WYSIWYG)
2. Go to the Plugins tab and check the templates plugin. Save plugins
3. Add the template plugin to a toolbar in the profiles tab. Save profile
4. Unless someone can get this working in the 'Extra configuration' section under 'Advanced':
open the file: modules/TinyMCE/templates/tinyconfig.tpl
5. add the following code AFTER line 80 which looks like this:
Code: Select all
{if $extraconfig!=''}
{$extraconfig}
{/if}
Code: Select all
{literal}
,template_cdate_classes : "cdate creationdate",
template_mdate_classes : "mdate modifieddate",
template_selected_content_classes : "selcontent",
template_cdate_format : "%m/%d/%Y : %H:%M:%S",
template_mdate_format : "%m/%d/%Y : %H:%M:%S",
template_replace_values : {
username : "Jack Black",
staffid : "991234"
},
template_templates : [
{
title : "Sample snippet",
src : "./tinymce_templates/test.htm",
description : "Sample snippet"
}
]
{/literal}
The code above was taken from the TinyMCE wiki: http://wiki.moxiecode.com/index.php/Tin ... s/template
Replace with your own values/settings etc.
If anyone can do this in a cleaner and more efficient way, please let us know.