I have an xslt macro for allowing content editors to insert text string page properties in the rich text editor. An example would be setting the "displayPhonNumber" in the top site page and then being able to use the macro to write something like:
Call us: <macro>
This works great for reusing block level elements but not so much for inline elements because tinyMCE will not allow the <div> of a macro to exist within a <p>.
I understand why this is important, I know that <p><div></div></p>
is not valid html. But when that macro renders its not going to be a div its just going to be a text string.
So is there a way to override tinyMCE's valid_children option and make divs valid children of p?
But that did not seem to have any effect so I am starting to wonder if I understand how tinyMCE is initialized in UMBRACO. Yes I did change and save web.config I even shut down the website and brought it back online. I also refreshed the App Pool and cleared my browser cache for good measure.
Quick update. It looks like what I added to the TinMceConfig is working, almost working...
It works as long as you do not touch the HTML Source Editor or make any edits after the initial save and publish. When it reloads the content into the editor it makes all the changes I described before.
TinyMCE valid_child
I have an xslt macro for allowing content editors to insert text string page properties in the rich text editor. An example would be setting the "displayPhonNumber" in the top site page and then being able to use the macro to write something like:
Call us: <macro>
This works great for reusing block level elements but not so much for inline elements because tinyMCE will not allow the <div> of a macro to exist within a <p>.
is not valid html. But when that macro renders its not going to be a div its just going to be a text string.
So is there a way to override tinyMCE's valid_children option and make divs valid children of p?
In tinyMceConfig.config I tried adding:
<config key="valid_children"><![CDATA[+p[div]]]></config>
But that did not seem to have any effect so I am starting to wonder if I understand how tinyMCE is initialized in UMBRACO. Yes I did change and save web.config I even shut down the website and brought it back online. I also refreshed the App Pool and cleared my browser cache for good measure.
Thanks in advance!
Quick update. It looks like what I added to the TinMceConfig is working, almost working...
It works as long as you do not touch the HTML Source Editor or make any edits after the initial save and publish. When it reloads the content into the editor it makes all the changes I described before.
is working on a reply...