Copied to clipboard

Flag this post as spam?

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


  • Damon 217 posts 288 karma points
    Oct 15, 2015 @ 16:57
    Damon
    0

    Is it possible to detect from razor code if a macro has been added to a rich text field?

    Hi,

    I need to be able to wrap some macro with a div with a class if it has been added to a rich text field. Is there a way to do this? Cannot do it in the macro partial view, because want the option to add more than one and the div needs to wrap them all for the js to work.

    Thinking about it, I would also need to know exactly where within the rich text field the macro was as well,

    Thanks a lot!

  • Alex Skrypnyk 6147 posts 24056 karma points MVP 8x admin c-trib
    Oct 15, 2015 @ 19:00
    Alex Skrypnyk
    0

    Hi Damon,

    You can try to add Macro Param to your macro and then use it when you are inserting your Macro in the RTE.

    https://our.umbraco.org/Documentation/Reference/Templating/Macros/managing-macros

    Thanks

Please Sign in or register to post replies

Write your reply to:

Draft