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.
Any ideas?
Thanks,
Bartosh
You’ll need something like the following:
It utilises the NiceUrl() method from the Umbraco library to generate the URL based on Id.
You might find the following cheatsheet quite useful when trying to figure out and navigate the underlying Umbraco XML: http://our.umbraco.org/wiki/reference/xslt/xpath-axes-and-their-shortcuts