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,
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!
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
is working on a reply...