Copied to clipboard

Flag this post as spam?

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


  • Jorge 37 posts 119 karma points
    Jan 25, 2023 @ 18:02
    Jorge
    0

    Parse text with macro into final output

    I have this simple text with macro from an external source.

    <p>asdfsadf</p>
    <?UMBRACO_MACRO macroAlias=""Map"" />
    <p>asdfasdf</p>"
    

    And I want this to display to my custom view but with the macro snippet converted correctly.

    If I try to paste it into one of Umbraco page rich text editor field it will render correctly as Umbraco will handle the conversion.

    However, that is not my case so I'm expecting to pull some custom code that will parse this text to render it correctly, and I'm not sure how to do that.

    I'm using Umbraco version 10

  • Huw Reddick 1736 posts 6076 karma points MVP c-trib
    Jan 26, 2023 @ 08:55
    Huw Reddick
    0

    Hi Jorge,

    Not entirely sure what you are asking, but Macros are rendered using

    @await Umbraco.RenderMacroAsync("myMacroAlias")
    
Please Sign in or register to post replies

Write your reply to:

Draft