Copied to clipboard

Flag this post as spam?

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


  • Eddie Foreman 215 posts 288 karma points
    Apr 03, 2012 @ 10:55
    Eddie Foreman
    0

    Macro Parameters from another level 1 node

    Hi All,

    I have a site which has the following stucture:

    Home
        site pages
        ...
    Settings
         contact form

    The contact form is a usercontrol which is used on all pages.  The macro parameters would get the email to, subject, etc...  Normally I would do this using resursive parameters :

     <umbraco:Macro EmailSubject="[$emailSubject]" EmailTo="[$emailTo]" Alias="ContactForm" runat="server"></umbraco:Macro> 

    The above approach takes me to the home node. I was wondring if it's possible to traverse to the root node, then down the settings node.

    Thanks,
    Eddie

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Apr 03, 2012 @ 12:08
    Lee Kelleher
    0

    Hi Eddie,

    As far as I know, it is not currently possible to specify/define which node the macro parameters get their values from. You would need to do that inside the macro itself.

    In contrast the <umbraco:Item> actually has a "NodeId" parameter which sets the context of the "Item" / value. Something like that might be useful for the Macro control/tag too.

    Cheers, Lee.

  • Eddie Foreman 215 posts 288 karma points
    Apr 05, 2012 @ 00:53
    Eddie Foreman
    0

    Hi Lee,

    Thanks for the info.  Ending up using the  Node API route to gain access to the required data.

    Cheers,

    Eddie

Please Sign in or register to post replies

Write your reply to:

Draft