Hi Folks, a reply on a 6 years old post......
I want to make it work again, using a defined template in the tinymce editor.
It's not that easy as i thought.....
I did modified the file: plugins/tinymce4/inits/init_fontawesome.js
To the following code:
Code: Select all
{
selector: "%SELECTOR%",
theme: "modern",
skin: "lightgray",
toolbar_items_size: "small",
menubar:false,
plugins: [
"advlist anchor autolink autosave charmap code colorpicker contextmenu emoticons fullscreen hr",
"image importcss insertdatetime link lists media nonbreaking paste",
"save searchreplace table template textcolor visualblocks visualchars wordcount fontawesome noneditable"
],
external_plugins: {
"fontawesome": "%CMSIMPLE_ROOT%plugins/fa/editors/tinymce4/fontawesome/plugin.min.js"
},
toolbar1: "save | fullscreen code formatselect fontselect fontsizeselect styleselect",
toolbar2: "bold italic underline strikethrough | alignleft aligncenter alignright alignjustify cut copy paste pastetext | bullist numlist outdent indent blockquote",
toolbar3: "undo redo | link unlink anchor image media | hr nonbreaking removeformat visualblocks visualchars | forecolor backcolor | searchreplace | charmap fontawesome",
toolbar4: "emoticons subscript superscript | template table insertdatetime help",
image_advtab: true,
image_title: true,
file_browser_callback: "%FILEBROWSER_CALLBACK%",
content_css: "%STYLESHEET%,%CMSIMPLE_ROOT%plugins/fa/css/font-awesome.min.css",
importcss_append:true,
style_formats_autohide: true,
importcss_selector_filter: /(?:([a-z0-9\-_]+))(\.[a-z0-9_\-\.]+)$/i,
%LANGUAGE%
element_format: "%ELEMENT_FORMAT%",
block_formats: "%HEADERS%;p=p;div=div;code=code;pre=pre;dt=dt;dd=dd",
"insertdatetime_formats": ["%H:%M:%S", "%d.%m.%Y", "%I:%M:%S %p", "%D"],
relative_urls: true,
convert_urls: false,
entity_encoding: "raw",
noneditable_noneditable_class: 'fa',
extended_valid_elements: 'span[*]'
}
template_templates : [
{
title : "My Snippet",
src : "snippet.htm",
description : "Adds a HTML snippet"
},
]
As you can see i added 'template' to the line of 'plugins' and added 'template' to the toolbar4 section.
Also ad this code on the bottom:
Code: Select all
template_templates : [
{
title : "My Snippet",
src : "snippet.htm",
description : "Adds a HTML snippet"
},
]
Then i create a htm file snippet.htm like this:
Code: Select all
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div class="mceTmpl">
<table width="98%%" border="0" cellspacing="0" cellpadding="0">
<tr>
<th scope="col">a cell</th>
<th scope="col">another cell</th>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
</div>
</body>
</html>
And i uploaded this htm file to the root.....
unfortunatley , when i click in the editor on the button to insert a template it says "No templates defined."
Where did i go wrong???