I've used one of the provided XSLT templates to display the child nodes of the current page for my navigation. My tree structure is:
- Home
..etc
When you're on the About Us page, it correctly writes out the About Us Sub1 and Sub2 Pages. Same with Products. However, because of the tree structure, if you're on the homepage, it writes out About Us, Products etc as if they're 2nd level pages. I want it to *think* that Home, About Us, Products etc are all on the same level (without changing the tree structure), and to write out NOTHING if you're on the home page. I thought the easiest solution would be to put an xsl "if" clause that only writes out the for-each statement if you're NOT on the homepage, but I can't get the syntax correct. Can someone show me what to add?
XSLT IF clause for navigation
Hi,
I've used one of the provided XSLT templates to display the child nodes of the current page for my navigation. My tree structure is:
- Home
..etc
When you're on the About Us page, it correctly writes out the About Us Sub1 and Sub2 Pages. Same with Products. However, because of the tree structure, if you're on the homepage, it writes out About Us, Products etc as if they're 2nd level pages. I want it to *think* that Home, About Us, Products etc are all on the same level (without changing the tree structure), and to write out NOTHING if you're on the home page. I thought the easiest solution would be to put an xsl "if" clause that only writes out the for-each statement if you're NOT on the homepage, but I can't get the syntax correct. Can someone show me what to add?
Thanks!
Here's the XSLT:
Might be a good idea to format your xslt as it looks rather crap right now!
-Copy code over to notepad (THE ultimate editor)
-Copy from notepad over here
-Select text and use preformatted style from the dropdown
Cheers,
/Dirk
Thanks Dirk.
Once more with feeling...
is working on a reply...