Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Rich Green 2246 posts 4008 karma points
    Nov 17, 2010 @ 17:30
    Rich Green
    0

    Getting the root node without currentpage

    I usually use this to get to the root of the site

    <xsl:variable name="absoluteRoot" select="$currentPage/ancestor-or-self::root" />

    However I would like to access the root node from a xslt file which is an include, which if I'm not mistaken does not have automatically have access to the currentpage variable.

    I'm sure I could pass the currentpage over to the include but I don't need it.

    How can I write the above without the currentpage variable?

    Cheers

    Rich

  • Sean Mooney 131 posts 158 karma points c-trib
    Nov 17, 2010 @ 18:10
    Sean Mooney
    1

    You should be able to use:

    <xsl:variable select="umbraco.library:GetXmlAll()"/>

    I believe it starts at the root

  • Kim Andersen 1447 posts 2197 karma points MVP
    Nov 21, 2010 @ 23:53
    Kim Andersen
    1

    You are right Sean. The GetXmlAll-extension actually shows the XML of the entire tree. So I have to agree - that should do the trick.

    /Kim A

  • Rich Green 2246 posts 4008 karma points
    Nov 26, 2010 @ 16:52
    Rich Green
    0

    Hi guys, 

    Sorry for not replying earlier, should work a treat.

    Cheers

    Rich

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies