Hi, I'll try to explain myself best I can. I have a master template for my header and my footer and subtemplate for body parts.
In my header, I call a macro that should be on each page. Parameters of this macro is called from the Runwayhomepage, so when I'm on the homepage it's ok, but when I go to a subpage, the macro doesn't work because it doesn't find the parameters on the page I'm (textpage doctype). I want it to look on homepage node to get the values.
So on my doctype Runway Homepage I've set a contentPicker and a true/false values to fill the [#blabla] in the macro. So when I'm on the homepage it works, but when I'm on another page, it can't find the value of both [#blabla]. How, in xslt, can I say ''even if I'm another page, look at homepage values for these parameters''?
There's no "Recursive" checkbox when I insert macro. Only when I insert page field. But if I find the "Recursive" checkbox, how this macro will know where to get the values of the parameters if there's any on the currentPage?
You can substitute a dollar-sign ($) for the hash (#) to get the recursive behavior in a macro.
So Umbraco will take the value from the closest parent page that has a value for the property specified. If none are specified it'll end up on the Homepage.
Macro parameters from another node
Hi, I'll try to explain myself best I can. I have a master template for my header and my footer and subtemplate for body parts.
In my header, I call a macro that should be on each page. Parameters of this macro is called from the Runwayhomepage, so when I'm on the homepage it's ok, but when I go to a subpage, the macro doesn't work because it doesn't find the parameters on the page I'm (textpage doctype). I want it to look on homepage node to get the values.
This is what's in my master template :
So on my doctype Runway Homepage I've set a contentPicker and a true/false values to fill the [#blabla] in the macro. So when I'm on the homepage it works, but when I'm on another page, it can't find the value of both [#blabla]. How, in xslt, can I say ''even if I'm another page, look at homepage values for these parameters''?
Thank you
Hi Profiterole,
That's what you use the "Recursive" checkbox for when inserting the macro.
/Chriztian
There's no "Recursive" checkbox when I insert macro. Only when I insert page field. But if I find the "Recursive" checkbox, how this macro will know where to get the values of the parameters if there's any on the currentPage?
Thank you for your help
Ah - sorry, too quick there.
Take a look at this: http://our.umbraco.org/wiki/reference/templates/umbracomacro-element/macro-parameters/advanced-macro-parameter-syntax
You can substitute a dollar-sign ($) for the hash (#) to get the recursive behavior in a macro.
So Umbraco will take the value from the closest parent page that has a value for the property specified. If none are specified it'll end up on the Homepage.
/Chriztian
Wow, what a great trick I wasn't aware of!! Thank a lot Chriztian!
is working on a reply...