The problem I'm having is that none of the macros are rendering on the blogroll. Macros are inserted using the richtext editor which contains text and macro content. If I view the page source it shows the unrendered "UMBRACO_MACRO" code block as it does in the HTML view of the editor.
Anyone have any ideas how I can get these macros to run?
What exact version of Umbraco 7 are you using? And what does your Razor code for rendering your blogposts look like? Inside the foreach statement I'm thinking?
Ok, not sure but think you might be able to do this @Html.Raw(umbraco.library.RenderMacroContent(@post.GetProperty("pageText").Value, @post.GetProperty("pageText").Id))
Macros not rendering
I've followed Sebastiaan's post here for creating a blog archive:
http://umbraco.com/follow-us/blog-archive/2014/1/27/a-practical-example-of-route-hijacking-in-umbraco
The problem I'm having is that none of the macros are rendering on the blogroll. Macros are inserted using the richtext editor which contains text and macro content. If I view the page source it shows the unrendered "UMBRACO_MACRO" code block as it does in the HTML view of the editor.
Anyone have any ideas how I can get these macros to run?
Thanks
Hi Shane
What exact version of Umbraco 7 are you using? And what does your Razor code for rendering your blogposts look like? Inside the foreach statement I'm thinking?
/Jan
Hi Jan,
I'm using version 7.2.1. I'm using a foreach statement as in the blog post. A simplified version is:
Thanks
Hi Shane
Ok, not sure but think you might be able to do this
@Html.Raw(umbraco.library.RenderMacroContent(@post.GetProperty("pageText").Value
, @post.GetProperty("pageText").Id))Try having a look at this post https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/48747-Rendering-Macros-From-Macro-Container-MVC
Hope this helps.
/Jan
You're a lifesaver. Thanks Jan!
is working on a reply...