Im using umbraco 4.5 and i want to know the root id so that i may use GetXmlnodebyId to retrieve all the pages which are directly below it...Please help on this ?? :(
the root id (of Content Folder) is acually not shown when we hover near it..it will only show for all it subpages...so i wanna know it so i may use it in my xslt...but i dont wanna use any other helper classes..
the root id (of Content Folder) is acually not shown when we hover near it..it will only show for all it subpages...so i wanna know it so i may use it in my xslt...but i dont wanna use any other helper classes..
I have some direct pages below it which i m needing it for showing as a set of links through xslt....So i need the root id so that i may get all its child nodes....
You could try getting them by level instead? Eveything at the root will be level 1. You could combine this with a specific doctypealias aswell to be a bit more specific?
this is my code... so node 1267 is a level 1 node....but i wanna get all level 1 nodes without harcoding the node id in xslt....so the better thing would be using my root id which wont change anytime....so i want it... i have tried root id but its not working in getxmlnodeby id......u got any ideas regarding this matt??
I would probably suggest that you try simplifying your XSLT and working your way up, as the last example I posted, I tried in a new install and it does work, so you may have an issue elswhere. Try removing your inner if statement for now, and just have the for-each loop. If this works, keep adding back more untill you find the point at which it breaks, then you know what you need to fix.
Root Id ??
Im using umbraco 4.5 and i want to know the root id so that i may use GetXmlnodebyId to retrieve all the pages which are directly below it...Please help on this ?? :(
Hi,
If you just want to "know" it, you can hover over a node in the admin area, and you'll see it's ID displayed in the status bar.
If you want to find it programaticaly, you could use hendys helper method which you can find here:
http://blog.hendyracher.co.uk/umbraco-helper-class/
Many thanks
Matt
the root id (of Content Folder) is acually not shown when we hover near it..it will only show for all it subpages...so i wanna know it so i may use it in my xslt...but i dont wanna use any other helper classes..
the root id (of Content Folder) is acually not shown when we hover near it..it will only show for all it subpages...so i wanna know it so i may use it in my xslt...but i dont wanna use any other helper classes..
The "Content" node, isn't actualy a node hence why it has no ID. You could try -1 though.
Can I ask what you are trying to do so that I might be able to help find an alternative.
Matt
I have some direct pages below it which i m needing it for showing as a set of links through xslt....So i need the root id so that i may get all its child nodes....
Hi,
You could try getting them by level instead? Eveything at the root will be level 1. You could combine this with a specific doctypealias aswell to be a bit more specific?
Matt
<xsl:for-each select="umbraco.library:GetXmlNodeById(1267)/../*">
<xsl:if test="contains(internalTags,'TECHNOLOGY') and $currentPage/@id != @id">
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="*[name()=concat('technologyNicename',$flang)]"/>
</a>
<br/>
</xsl:if>
</xsl:for-each>
this is my code... so node 1267 is a level 1 node....but i wanna get all level 1 nodes without harcoding the node id in xslt....so the better thing would be using my root id which wont change anytime....so i want it... i have tried root id but its not working in getxmlnodeby id......u got any ideas regarding this matt??
How about
Matt
No its not working matt :(
Give this a try for your for-each
Matt
umbraco.library:GetXmlAll() should work for you as well.
Both Didnt Work ppl...:(.
Hey,
I would probably suggest that you try simplifying your XSLT and working your way up, as the last example I posted, I tried in a new install and it does work, so you may have an issue elswhere. Try removing your inner if statement for now, and just have the for-each loop. If this works, keep adding back more untill you find the point at which it breaks, then you know what you need to fix.
Matt
Hi raghavendran,
You get to the root node with ancestor-or-self::root:
The level 1 node are right below that, so:
will get them for you.
(Matt's earlier example was OK but he accidentally capitalized the isDoc attribute to IsDoc, which is why it didn't work).
/Chriztian
thanks Chriztian,
It works perfectly now....U rock :)
regards,
Raghav
Dang it. I knew I was close =)
Cheers Chriztian, I'll be sure to commit that to memory =)
Matt
is working on a reply...