I want to show *all* the level 1 documents (Home, Resume, Portfolio etc..). Yet if I set @level = 1 the XLST above shows the children of the level 1 ancestor of the current page. Which makes sense because that's what this XLST above should do:
<!-- Front the current page find the ancestor (or self) that has a level = 1 $currentPage/ancestor-or-self::* [@level=$level]
<!--Find all children of the level 1 ancestor that are a doc and not hidden--> /* [@isDoc and string(umbracoNaviHide) != '1']
So what I found is that I can then find the parent of the level 1 ancestor of the current page, and then find all the children of that parent and then get all the level 1 documents.
<xsl:for-each select="$currentPage/ancestor-or-self::* [@level=$level]/parent::*/* [@isDoc and string(umbracoNaviHide) != '1']">
This, however, seems like an incredibly round about way of accessing all the level 1 documents. Can I instead write a XPath query based of the root of the entire site rather then the $currentPage?
Also, is there someway to download the XML for an entire site or at least a the current page so I can have a better understanding of what the XLST I'm writing is working on?
Do Umbraco XLST templates always have to be based off $currentPage?
I'm trying to setup a top navigation bar on my Umbraco site using version 4.5.2. My site structure looks something like this
Content
Home
Resume
Portfolio
School
Job 1
Job 2
Activities
Projects
Project 1
Project 2
Contact
Now I want a Top navigation bar that lists the following regardless of what page or page level the user is at.
Home| Resume | Portfolio | Activities | Projects | Contact
Most of the examples I've seen for navigation bars use a for-each statement like the one shown below.
I want to show *all* the level 1 documents (Home, Resume, Portfolio etc..). Yet if I set @level = 1 the XLST above shows the children of the level 1 ancestor of the current page. Which makes sense because that's what this XLST above should do:
<!-- Front the current page find the ancestor (or self) that has a level = 1
$currentPage/ancestor-or-self::* [@level=$level]
<!--Find all children of the level 1 ancestor that are a doc and not hidden-->
/* [@isDoc and string(umbracoNaviHide) != '1']
So what I found is that I can then find the parent of the level 1 ancestor of the current page, and then find all the children of that parent and then get all the level 1 documents.
This, however, seems like an incredibly round about way of accessing all the level 1 documents. Can I instead write a XPath query based of the root of the entire site rather then the $currentPage?
Also, is there someway to download the XML for an entire site or at least a the current page so I can have a better understanding of what the XLST I'm writing is working on?
Eric,
You can access the root xml node using
so a for-each that would select each child of the root node would be something like
BTW I havent tried that out myself so let me know if how it works out.
Re downloading the XML - if you look in the Umbraco.config file (App_Data) that shows you the XML that any XSLT macros will be dealing with.
is working on a reply...