Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • wschwarte 44 posts 73 karma points
    Sep 03, 2014 @ 22:05
    wschwarte
    0

    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:

    @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.)

    thanks

     

     

     

     

  • wschwarte 44 posts 73 karma points
    Sep 04, 2014 @ 10:43
    wschwarte
    0

    Ok, got this, i can just use @CurrentPage.nodeID for this

     

Please Sign in or register to post replies

Write your reply to:

Draft