@Chriztian: I don't that will work because it's not a docType defined property but I'll give it a go tomorrow morning.
@kipusoep: My apologies for not giving more details but I have that code snippet in a master page and I need to pass the parent node id from the master page to an XSLT macro.
Anyway, thank you both for taking the time to read and answer my query.
Pass current page node id to xslt macro
I am currently doing the following:
Snippet
As you can see, I've hardcorded the parent node id (1270). How can I dynamically pass the current page's parent node id?
I've found this http://umbraco.org/documentation/books/macro-parameters-syntax/advanced-parameter-syntax but they don't really help with what I'm trying to do.
Any way of doing this nicely?
TIA,
David
Hi David,
Have you tried [#parentID] ? Based on that page's examples, that would be how to do it, I'd say...
/Chriztian
Don't pass it as parameter...
You can access it in XSLT itself. By default this is included in your XSLT:
You can then access the parent with this:
@Chriztian: I don't that will work because it's not a docType defined property but I'll give it a go tomorrow morning.
@kipusoep: My apologies for not giving more details but I have that code snippet in a master page and I need to pass the parent node id from the master page to an XSLT macro.
Anyway, thank you both for taking the time to read and answer my query.
David
You can use this to do it: http://our.umbraco.org/forum/developers/api-questions/5407-Macro-parameters-from-codebehind
Aha!! This looks like it could do the trick. I'll try it tomorrow morning and let you know what happens.
is working on a reply...