Copied to clipboard

Flag this post as spam?

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


  • Karl 13 posts 126 karma points
    Feb 12, 2015 @ 13:59
    Karl
    0

    Render macro from rich text

    Hi

    I am displaying content from an RTE, this is working fine. But when we insert a macro into the RTE it does not get displayed.

    I have included a snippet for reference, any help would be much appreciated.

    Thanks

    @foreach (var tab in modeTab.Children)

                        {

                            <div role="tabpanel" class="tab-pane @tab.Id">

                                @Html.Raw(tab.GetPropertyValue("tab"))

                            </div>

                        }

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Feb 12, 2015 @ 14:31
    Jan Skovgaard
    0

    Hi Karl

    How are you rendering the rich text editor content? And what version of Umbraco are you using?

    /Jan

  • Karl 13 posts 126 karma points
    Feb 12, 2015 @ 16:02
    Karl
    0

    Thanks

    Version 7.2.0

    I am using razor to render the rich text content.

    I am using DynamicNode and passing the page id, I am then looping through the children and using GetPropertyValue to display the content.

    It works fine for standard html but not macro content.

    Thanks

  • Karl 13 posts 126 karma points
    Mar 20, 2015 @ 12:29
    Karl
    101

    Fixed by using the following:

    @(Html.Raw(library.RenderMacroContent(tab.GetPropertyValue("tab"), CurrentPage.Id)))

Please Sign in or register to post replies

Write your reply to:

Draft