By eigentor on
Did anybody yet get the "Template" plugin of Tinymce up and running in Drupal? I'm finding this a very nice feature and one thing that put fckeditor above Tinymce for a while.
In the moxiecode documentation it says to initialize it by putting this code in the template:
tinyMCE.init({ theme : "advanced", mode : "textareas", plugins : "template", theme_advanced_buttons3_add : "template" 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 : "Editor Details", src : "editor_details.htm", description : "Adds Editor Name and Staff ID" }, { title : "Timestamp", src : "time.htm", description : "Adds an editing timestamp." } ] });Well, I did this but still the template button does not show up.
As I understand, this kind of manual initialisation should not be necessary in drupal, because plugins can be activated on the config page for "buttons and plugins" in the admin panel.
But alas, the template plugin is not shown there, so what can I do?
Comments
Tinymce module doesn't
Tinymce module doesn't support template_templates as of 1.90.4.23
But you can hack it:
Look for this line around line 109
if (strtolower($v) != 'true' && strtolower($v) != 'false' && $v[0] != '{' ) {Change it to this:
if (strtolower($v) != 'true' && strtolower($v) != 'false' && $v[0] != '{' && $v[0] != '[') {Then in your templates.php file add something like this:
Hope that helps
TinyMCE Template-Plugin
It also works if you add this to your plugin_req.php
Change the tinymce.module like joelpittet mentioned above
And then add this to your theme_tinymce_theme() function in tinymce.module or in your template.php
More Infos about Templates can you find here:
http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/template#Each_templa...
http://drupal.org/project/wys
http://drupal.org/project/wysiwyg_template takes care of this.