Copied to clipboard

Flag this post as spam?

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


  • Galina 44 posts 258 karma points
    Sep 16, 2014 @ 15:32
    Galina
    0

    Insert macro in RTE as HTML

    Hello.

    I have a very strange task: I need to add umbraco macro as html tags in RTE. 

    The full task is: it's needed to show a content of a property from parent page (recursive=true") in special element (for example in <pre>) and add this content (umbraco macros and html tags) in RTE. I've created custom RTE ( http://www.enkelmedia.se/blogg/2013/12/4/umbraco-7-use-the-rich-text-editor-tinymce-in-a-custom-section.aspx) and try to add 

    <?UMBRACO_MACRO macroAlias="DetailDetail" IsDetail="0" IsReview="0" DetailId="5814311" EntityID="5814311" ViewId="" Style="" Type="" BannerId="" />

    in "Source code" ("code" button) in RTE (tinyMCE3 and mine). After this the RTE change my code

    <!--?UMBRACO_MACRO macroAlias="DetailDetail" IsDetail="0" IsReview="0" DetailId="5814311" EntityID="5814311" ViewId="" Style="" Type="" BannerId="" ?-->

    and nothing shows.

    Is it possible to add umbraco macro as html?

  • Galina 44 posts 258 karma points
    Sep 17, 2014 @ 09:52
    Galina
    0

    Ok, I've found a section <validElements> in \config\tinyMceConfig.config. Is it possible to add tag "?UMBRACO_MACRO" to valid Elements? The "?" is a control character for tinyMce. And how to render added macro in RTE? Any ideas?

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Sep 17, 2014 @ 12:15
    Jeroen Breuer
    0

    I always change the validElements to this:

    <validElements><![CDATA[*[*]]]></validElements>

    Than all elements are valid so you can do much more in the RTE.

    Jeroen

  • Galina 44 posts 258 karma points
    Sep 17, 2014 @ 12:57
    Galina
    0

    Thank you, Jeroen. It's possible to add 

    <?UMBRACO_MACRO macroAlias="DetailDetail"IsDetail="0"IsReview="0"DetailId="5814311"EntityID="5814311"ViewId=""Style=""Type=""BannerId=""/>

    to RTE, but it doesn't render. I think I should somehow render it with js and postback.

Please Sign in or register to post replies

Write your reply to:

Draft