A breakdown of this... From the current page, go all the way up to the root node (level 1), then down the nodes to the 'Blog' node type, then down to level 5 node - then list the child nodes that aren't hidden.
The XPath could be condensed, but would need to know a little more about the content structure.
It should be possible in one statement, as what you are doing is navigating to the root and then re-narrowing down.
Did you update the alias' in my example (I don't know what your alias' are so just made a guess).
What it should be doing is navigating to the root, then selecting any node of type "blog" and then any sub node of type "blogpost" that is set to display in the nav.
If I understand correctly, you are basically wanting to create a list blogposts on the site?
List Pages by Node Alias Level
So this is my dilemma. This works for every other page on the site besides when i navigate to the pages that the for each list.
<xsl:for-each select=" $currentPage/ancestor-or-self::node//node [@nodeTypeAlias ='Blog']/descendant::node[@level=5]/node[string(data[@alias='umbracoNaviHide']) != '1'] ">
Hi Eric,
Are you trying to find a blog node within the current pages ancestory? Or just any page which is a blog?
Try one of these:
Matt
Hi Eric,
Its a bit long-winded, but I don't know much about your content structure, try this:
A breakdown of this... From the current page, go all the way up to the root node (level 1), then down the nodes to the 'Blog' node type, then down to level 5 node - then list the child nodes that aren't hidden.
The XPath could be condensed, but would need to know a little more about the content structure.
Cheers, Lee.
Those got the same results as the code above. Here is my content structure. I have the maco pulling the list in the master template.
So the code above will list the blog pages on Home and Pages 1 & 2 but will not list the blog pages on the Blog page nor any node below.
Hope this helps.
My content tree is like the following
Home
-Page 1
-Page 2
-Blog
- Year
-Month
- Day
- Blog Page
Would something like this work?
Matt
Yea that didnt work either. Wonder if i have to do a choose base on the location in the content tree.
It should be possible in one statement, as what you are doing is navigating to the root and then re-narrowing down.
Did you update the alias' in my example (I don't know what your alias' are so just made a guess).
What it should be doing is navigating to the root, then selecting any node of type "blog" and then any sub node of type "blogpost" that is set to display in the nav.
If I understand correctly, you are basically wanting to create a list blogposts on the site?
Matt
My bad It works, I thought the logic was correct. The page wasn't refreshing. Sometimes it the most simplest thing that get you.
Thanks again for you help.
Hehe, glad you got it working.
Matt
is working on a reply...