Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
not able to build navigation tree based on page name in sitemap
abdu47
I am trying to build a navigation tree based on the current page. I am using sitemap getSiteMap which makes sitemap available to the current component. $CONTEXT{pageName} by itself gives me the pagename but when I try to use it in xsl:for-each it is not able to build the tree. Any ideas how to approach this? is it suppose to work?
Here is part of my XSL
<xsl:for-each select=" //node[node/link/value='$CONTEXT{pageName}']/node">
<xsl:value-of select="label"/>
</xsl:for-each>
I tried putting the value manually and it seems to be working just fine so the XPath is correct. for example
<xsl:for-each select="//node[node/link/value='en/about_us']/node">
Find more posts tagged with
Comments
kmu
This is a very strange XPath query - what is the loop trying to find in context? I mean - in which context do you use this loop? I believe the issue is your XPath query.
Literally your loops looks for 'node' that has a parent 'node' with a child which matches the current page - in other words you have create a very complicated way of looking for siblings of the current page node (and it only works if they have a parent 'node').
Stokes
If you're using 3.1, the breadcrumb and other navigation components are good examples that do something similar to what you're attempting.