What version of Umbraco are you doing this on? If it's newer than 4.5 then you should probably use this instead - If you know you need to get the homepage type then you can just call the node type alias like this if I remember correctly. What you're doing above looks like the old schema syntax from before Umbraco 4.5 :)
You my friend are an internation superstar! That's been killing me for ages!
Another quick one though, it's possible that in the future I'll have to do this for a separate area in my content tree but both area's will share the same Node Type Alias (which is why I was trying to target the node from it's ID). Do you know of a way to do that?
You can also do it by id if you'd like...then it must look like this
<xsl:variable name="startNode" select="$currentPage/ancestor-or-self::*[@isDoc and @id='1260']" /> should work...it's from the top of my mind though so there is a chance that the syntax might be slightly off but.
But what would your structure for the above scenario look like? Because if those two areas are living in each of their sub-branch you should be able to use the same approach as you did for finding the homepage node using the ancestor-or-self axe. Chriztian "I eat XSLT for breakfast 24/7/365" Steinmeier has made a nice visualizer on using axes here http://pimpmyxslt.com/axesviz.aspx - That might be useful.
Then's all be on the same level in the tree, I see so what you're saying is that the $currentPage/ancestor-or-self will stop on the first one that it finds?
Loop through a certain nodes children
Hi all,
This is driving me scatty but what I'm trying to acheive is to build a menu based upon the children of a certain node in my tree.
This is how I'm setting the 'parent' node (ID = 2421 and it's got 2 children)
And this is how I'm trying to loop through the children
It looks fine (to me) and I'm getting no errors but it's not falling into the loop. Could someone point out my stupidity please?!?!
Thanks,
Craig
Hi Craig
What version of Umbraco are you doing this on? If it's newer than 4.5 then you should probably use this instead - If you know you need to get the homepage type then you can just call the node type alias like this if I remember correctly. What you're doing above looks like the old schema syntax from before Umbraco 4.5 :)
Hope this helps.
/Jan
You my friend are an internation superstar! That's been killing me for ages!
Another quick one though, it's possible that in the future I'll have to do this for a separate area in my content tree but both area's will share the same Node Type Alias (which is why I was trying to target the node from it's ID). Do you know of a way to do that?
Thanks again
Now I'm blushing :D - Glad it helped!
You can also do it by id if you'd like...then it must look like this
<xsl:variable name="startNode" select="$currentPage/ancestor-or-self::*[@isDoc and @id='1260']" />
should work...it's from the top of my mind though so there is a chance that the syntax might be slightly off but.But what would your structure for the above scenario look like? Because if those two areas are living in each of their sub-branch you should be able to use the same approach as you did for finding the homepage node using the ancestor-or-self axe. Chriztian "I eat XSLT for breakfast 24/7/365" Steinmeier has made a nice visualizer on using axes here http://pimpmyxslt.com/axesviz.aspx - That might be useful.
/Jan
Then's all be on the same level in the tree, I see so what you're saying is that the $currentPage/ancestor-or-self will stop on the first one that it finds?
Hi Craig
Yes that's what it's going to do. So if you need to fetch from 2 different nodes from the same node level then id is the way to go I think.
/Jan
Got it.
Overthinking the whole thing, great work and great assistance again :)
is working on a reply...