If you just need the Ids for some reason, you can grab the @path attribute - it contains a "path of Ids" to the selected node, e.g.:
If you have this setup:
Home (id:1050)Node1 (id:1052)
Node2 (id:1053)
Node3 (id:1054)
Node4 (id:1055)
You can try:
<xsl:value-of select="$currentPage/@path" /> <!-- Will output: -1,1050,1052,1055 -->
But you don't need the Ids if you just want to access the actual nodes - the ancestor-or-self:: axis will select them for you:
Get all id parent from currentPage
Hi everybody
there is a way to get all parent id Node from a certain node?
for example
node 1
node2
node3
node4
node5.....
and i choose node4, but i need to know all id parents, node1-node2-node4
there is a function in umbraco.library or some recursive templete to do this??
regards.
Are you talking about something lika a breadcrumb? I think that theres a build in template for that. But something like this:
<xsl:for-each select="$currentPage/ancestor::* [@level > $minCrumbLevel and string(umbracoNaviHide) != '1']">
<li>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="@nodeName"/>
</a>
</li>
</xsl:for-each>
Hi Cristian,
If you just need the Ids for some reason, you can grab the @path attribute - it contains a "path of Ids" to the selected node, e.g.:
But you don't need the Ids if you just want to access the actual nodes - the ancestor-or-self:: axis will select them for you:
/Chriztian
Thanks for you reply! both of you.
@path was the property that i was looking for!
is working on a reply...