I am trying to output the contents of a macro container (containing multiple parameterized macros) in a Razor template but have been having trouble. I have listed everything already tried below. Assuming contentContainer is the alias of my macro container property:
After a bit of debugging, I've noticed that the 'Value' of my property doesn't actually contain any data. However, the 'DataValue' field looks to contain some data relating to the macros in the container:
Obviously I can reference the 'DataValue' field directly, but this goes against all the suggestions I've seen so far.
I've also been unable to locate any documentation on iterating through each macro inside a macro container (I am allowing up to 3 to be inserted). Any information on this would also be appreciated, as this is the next step.
Did you ever find a way to solve this? If not could you then please let us know what exact version of Umbraco you'e using? Then it's possible to figure out if it might be caused by a bug or if the way to render it has changed for instance.
I'm having the same kind of issue. The value of a richtext editor property stored in a C# string and I'd like to render it, including a UserControl Macro.
I've tried umbraco.library.RenderMacroContent and the output is in fact the UserControl, but the real content of the UserControl is missing, because OnLoad isn't even called at all.
So now I'm using <umbraco:Item runat="server" Field="description" /> which works, but it's not really what I'm looking for...
Render contents of Macro Container
Hi all,
I am trying to output the contents of a macro container (containing multiple parameterized macros) in a Razor template but have been having trouble. I have listed everything already tried below. Assuming contentContainer is the alias of my macro container property:
Hi Ryan and welcome to our :)
Did you ever find a way to solve this? If not could you then please let us know what exact version of Umbraco you'e using? Then it's possible to figure out if it might be caused by a bug or if the way to render it has changed for instance.
/Jan
I'm having the same kind of issue. The value of a richtext editor property stored in a C# string and I'd like to render it, including a UserControl Macro.
I've tried
umbraco.library.RenderMacroContent
and the output is in fact the UserControl, but the real content of the UserControl is missing, becauseOnLoad
isn't even called at all.So now I'm using
<umbraco:Item runat="server" Field="description" />
which works, but it's not really what I'm looking for...is working on a reply...