Still no answer. I have done some more research on this (Google "tinymce removes tags") and it seems a common problem for other CMS or general users of the TinyMCE Editor, where it should be possible to change TinyMCE settings using the valid_elements or extended_valid_elements configuration variables. See the following post as an example in reference to Wordpress:-
https://www.leighton.com/blog/stop-tinymce-in-wordpress-3-x-messing-up-your-html-code
Viewing the \Composite\content\misc\editors\visualeditor\tinymce__tinymce.min.js__ file supplied with C1 (not very easy as its minified), I can see reference to those variables, and what I presume are setting of default values which I suppose will get overridden if the variables are set and passed in, for example by C1.
I made a backup of the tinymce.min.js, then tried tweaking the code in various ways to see if I could affect the way it works, but without success.
I also see that the \Composite\content\misc\editors\visualeditor__visualeditor.js__ looks like it holds a config section for TinyMCE. So I have tried experimenting with adding
I appreciate that TinyMCE is outside the domain of C1 support, but surely I am on the right track with figuring out how to fix this problem?
It is particularly frustrating because I want end users of the Visual Editor to be able to easily copy and paste more complex sections of styling code into the editor to get the look they can see should be achievable with the template they have chosen, without the editor removing important parts of the code! Users will also become annoyed if they have to constantly make workarounds in the code.
Bootstrap templates regularly make use of empty tags to attach styles to and TinyMCE removing them is not fun.
Configuring the Visual Editor to work well is really one of the most important parts of setting up Composite C1 (I have spent many hours, and find the way the Visual Editor common.xml file is laid out is confusing and the C1 documentation for adding Block/Style/Class selectors, while reasonably good, could be clearer). I get the feeling that other developers working to make the Visual Editor work with their chosen template face similar problems, or give up!
Any suggestions?
Thanks for looking.
Jim
https://www.leighton.com/blog/stop-tinymce-in-wordpress-3-x-messing-up-your-html-code
Viewing the \Composite\content\misc\editors\visualeditor\tinymce__tinymce.min.js__ file supplied with C1 (not very easy as its minified), I can see reference to those variables, and what I presume are setting of default values which I suppose will get overridden if the variables are set and passed in, for example by C1.
I made a backup of the tinymce.min.js, then tried tweaking the code in various ways to see if I could affect the way it works, but without success.
I also see that the \Composite\content\misc\editors\visualeditor__visualeditor.js__ looks like it holds a config section for TinyMCE. So I have tried experimenting with adding
valid_elements : "*[*]"
or
extended_valid_elements : "*[*]"
into the var = config = { ....} section (restarting C1 and the editor between changes), but the editor still removes empty tags.I appreciate that TinyMCE is outside the domain of C1 support, but surely I am on the right track with figuring out how to fix this problem?
It is particularly frustrating because I want end users of the Visual Editor to be able to easily copy and paste more complex sections of styling code into the editor to get the look they can see should be achievable with the template they have chosen, without the editor removing important parts of the code! Users will also become annoyed if they have to constantly make workarounds in the code.
Bootstrap templates regularly make use of empty tags to attach styles to and TinyMCE removing them is not fun.
Configuring the Visual Editor to work well is really one of the most important parts of setting up Composite C1 (I have spent many hours, and find the way the Visual Editor common.xml file is laid out is confusing and the C1 documentation for adding Block/Style/Class selectors, while reasonably good, could be clearer). I get the feeling that other developers working to make the Visual Editor work with their chosen template face similar problems, or give up!
Any suggestions?
Thanks for looking.
Jim