well i've been trying to convert a simple site from xslt/webformsusing MVC / Razor, but i am still struggling. I watched the video's on umbraco.tv and they seem very clear, but do not cover everything.
so i created a "scripting file" and "macro" (I do not know what the difference is between this and "partial view macro files", umbraco.tv did not cover this. ) and i added a parameter to the macro.
I put this on my master view template using the macro button:
@Umbraco.RenderMacro("MyMacroAlias", new {nodeID=[$nodeID]})
I have a content picker on the page as a property. In the xslt version i could pass this id and do stuff with it.
How can I pass this ID with my new setup? Above doesn't seem to work. (if I change $nodeID to a number i do get this in my macro code, so that is working.)
Razor Macro Parameter for Page Property
well i've been trying to convert a simple site from xslt/webforms using MVC / Razor, but i am still struggling. I watched the video's on umbraco.tv and they seem very clear, but do not cover everything.
so i created a "scripting file" and "macro" (I do not know what the difference is between this and "partial view macro files", umbraco.tv did not cover this. ) and i added a parameter to the macro.
I put this on my master view template using the macro button:
I have a content picker on the page as a property. In the xslt version i could pass this id and do stuff with it.
How can I pass this ID with my new setup? Above doesn't seem to work. (if I change $nodeID to a number i do get this in my macro code, so that is working.)
thanks
Ok, got this, i can just use @CurrentPage.nodeID for this
is working on a reply...