Hi,
I am trying to customize the tinymce in the CMS in order to be able to enter small html templates that are of the following form:
<div class="my-note">
enter the text of your note here
</div>
without toggling to html edition.
I put this in mysite/_config.php
HtmlEditorConfig::get('cms')->enablePlugins('template');
HtmlEditorConfig::get('cms')->addButtonsToLine(2, 'template');
HtmlEditorConfig::get('cms')->setOptions(array('template_templates'=>array(
array('title'=>'div-note','src'=>'mysite/templates/note.html','description'=>'Note'),
array('title'=>'div-listing','src'=>'mysite/templates/listing.html','description'=>'Listing'),
array('title'=>'div-code','src'=>'mysite/templates/code.html','description'=>'Code'),
then I wrote the following templates in mysite/templates/
note.html
<div class="my-note"> enter the text of your note here
</div>
and similar for listing.html and code.html
Then I visited mysiteadress/dev/build
and mysiteadress/admin/?flush=all
Results:
I have a button in the editor toolbar that allow to open a window and to chose the template.
But what is injected in my page is not the template but
<p> enter the text of your note here</p>
I don't understand why I have my text in paragraph instead of the div I put into the template?
Thank you for help.