Hi. I'm using Umbraco 6.0.3, WebForms. My macros have razor code. I want to insert other macro's output into first macro. There are different ways of doing it:
3. Use filename like @RenderPage("~/Views/Partials/uBlogsy/Post/uBlogsyPostListLabels.cshtml", new { Node = node }) (it will not honor backend macro settings and looks like a bad practice anyway)
4. http://incoders.blogspot.ru/2011/10/render-macro-umbraco-exmaple.html This one actually works! And I am going to use it for now (or I'll stick to using razor @helpers since my current task is pretty lightweight). But it totally looks like a hack. Isn't there some built-in Umbraco method to render macro from razor?
A very good question. Did you get an answer? I need to render a razor script from within a razor script precisely because i want different caching on each script. Did you find option 2 to work?
Render Macro by alias from Razor code
Hi. I'm using Umbraco 6.0.3, WebForms. My macros have razor code. I want to insert other macro's output into first macro. There are different ways of doing it:
1. http://stackoverflow.com/questions/10689284/umbraco-render-net-user-control-ascx-macro-with-razor (would not honor caching settings, I believe)
2. https://github.com/tocsoft/Umbraco-Razor-Components (this one explicitly looks for Cache, that's why I believe it will work)
3. Use filename like @RenderPage("~/Views/Partials/uBlogsy/Post/uBlogsyPostListLabels.cshtml", new { Node = node }) (it will not honor backend macro settings and looks like a bad practice anyway)
4. http://incoders.blogspot.ru/2011/10/render-macro-umbraco-exmaple.html
This one actually works! And I am going to use it for now (or I'll stick to using razor @helpers since my current task is pretty lightweight). But it totally looks like a hack. Isn't there some built-in Umbraco method to render macro from razor?
A very good question. Did you get an answer? I need to render a razor script from within a razor script precisely because i want different caching on each script. Did you find option 2 to work?
Thanks
Dan
is working on a reply...