Hi !
I would like to create TinyMCE's html template.
With MODx Revolution 2.2.6-pl, TinyMCE 4.3.3-pl seems to allows html5 tags. Here is an extract of file /assets/components/tinymce/xconfig.js :
var tinymce_valid_elements = ''+'a[accesskey|charset.....'......+'article[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress'
+'|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style'
+'|title],'+......+'h2[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick'
+'|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove'
+'|onmouseout|onmouseover|onmouseup|style|title],'+......
In system config, I add ",template" at the end of tiny.custom_plugins.
Then, I set "custom_buttons3 : template".
Finally, I set tiny.template_list : "simpleSection:assets/templates/simpleSection.html:test section"
simpleSection.html looks like this :
<h2>Title</h2><p>Text</p>
Until now, everything works good, I can use it in TinyMCE editor. However when I try to use a more complex template, it does not work anymore...
I have 2 problems in particular :
- if I add a class into the title element for example, the text between the tags disappears
- if a use html5 tags (<article> for example), they are replaced by <p>
Does anyone know where the problem is?
Thank you in advance