Copied to clipboard

Flag this post as spam?

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


  • Keilin Olsen 2 posts 72 karma points
    Jan 17, 2017 @ 04:45
    Keilin Olsen
    0

    RichText content in an Umbraco Form field won't display macro

    What I'm trying to do:

    • include CMS editable rich text in an Umbraco Form
    • must be in a custom field so that it's client-movable
    • Rich text will potentially contain macros

    The problem so far:

    managed to get all of the above working, but the macros do not render, instead it comes out as:

    <!--?UMBRACO_MACRO macroAlias="InsertLightboxLink" LightboxContent="17281" LinkText="Foo bar" LightboxId="null" /-->
    

    I have found a few similar threads on the forum and StackOverflow which suggest using alternate forms like:

    <umbraco:Item field="bodyContent" runat="server"></umbraco:Item> 
    

    instead of

    @Model.bodyContent
    

    But this doesn't appear to help (the umbraco:Item tag just appears as-is in the generated output)


    Seems like I must be missing something blatantly obvious...

  • Keilin Olsen 2 posts 72 karma points
    Jan 23, 2017 @ 09:32
    Keilin Olsen
    0

    Solved.

    Need to get the string content of the referenced node, and an ID for some reason

    Used the following to render the inner macro:

    @Html.Raw(umbraco.library.RenderMacroContent(contentNodeText, contentNodeItemId));
    
Please Sign in or register to post replies

Write your reply to:

Draft