Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • cchehn 28 posts 69 karma points
    Feb 22, 2013 @ 15:33
    cchehn
    0

    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>.

    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?

    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!

     

  • cchehn 28 posts 69 karma points
    Feb 22, 2013 @ 16:00
    cchehn
    0

    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.

Please Sign in or register to post replies

Write your reply to:

Draft