Copied to clipboard

Flag this post as spam?

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


  • Peter Alcock 113 posts 176 karma points
    Feb 20, 2013 @ 12:31
    Peter Alcock
    0

    Passing Parent Field in Macro

    Hi all,

    Looking for some help if it's possible!

    I need to see if it's possible to pass a parent nodes field value through a macro. The current macro looks this this if run from the parent template

    <umbraco:Macro PropertyID="[#pageID]"  Alias="ucBookingForms" runat="server"></umbraco:Macro>

    But what i need to do is the parent node has a child which runs this macro but needs to still use the pageID of the parent if that makes sense!

    In a nutshell it needs to look like this

    <umbraco:Macro PropertyID="(parentnode)/[#pageID]"  Alias="ucBookingForms" runat="server"></umbraco:Macro>

    Cheers all

    Pete

  • Mike Chambers 635 posts 1252 karma points c-trib
    Feb 20, 2013 @ 14:34
    Mike Chambers
    0

    still pass in the page Id to the macro as in the original and then in the macro get the parent node and it's id...

    not knowing what type of macro this is...

    xslt? usercontrol? razor? the approach would be slightly different.

  • Peter Alcock 113 posts 176 karma points
    Feb 20, 2013 @ 14:40
    Peter Alcock
    0

    Hiya thanks for the reply,

    sorry should have mentioned that! it's passing into a usercontrol which in essence is a booking form, the pageid tells the form what property the person is interested in if that makes sense.

    Cheers

  • Mike Chambers 635 posts 1252 karma points c-trib
    Feb 20, 2013 @ 15:47
    Mike Chambers
    0
    Document d = new Document(PropertyID);
    int ParentId = d.ParentId;
Please Sign in or register to post replies

Write your reply to:

Draft