I am developing a simple app in Umbraco CMS. The thing I want to achieve is built an automated link which will appear on every single level 2 element and will lead to its parent element on level 1. Example:
item 1
subItem a
subItem b
subItem c
item 2
subItem d
subItem e
The link from pages a,b and c should target item 1, while d and e link should lead to item 2.
I assume I should use some macro XSLT code to link my element with its parent object in level 1 menu structure, but I do not know how to do it.
Automated link button
I am developing a simple app in Umbraco CMS. The thing I want to achieve is built an automated link which will appear on every single level 2 element and will lead to its parent element on level 1. Example:
The link from pages a,b and c should target item 1, while d and e link should lead to item 2.
I assume I should use some macro XSLT code to link my element with its parent object in level 1 menu structure, but I do not know how to do it.
Any ideas?
Thanks,
Bartosh
Hi Bartosh and welcome to the community! :)
You should be able to fetch the node id from the parent by using the :parent axis.
Something like this should do the trick (from the top of my head).
<xsl:value-of select="umbraco.library:NiceUrl($currentPage/parent::*[@isDoc]/@id)" />
Hope this helps.
/Jan
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.