Copied to clipboard

Flag this post as spam?

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


  • Tim 1193 posts 2675 karma points MVP 4x c-trib
    Nov 10, 2009 @ 14:19
    Tim
    0

    Select Root Node Only

    Hi,

    For the footer navigation of my website, I am considering assigning a related links datatype to the home page, and then having a macro that pulls out the selected links and displays the links in the site footer.

    Does anyone know the xslt query syntax for selecting just the root node, without traversing back through all the ancestor nodes?

  • Chris Koiak 700 posts 2626 karma points
    Nov 10, 2009 @ 14:33
    Chris Koiak
    0

    Hi Tim,

    Traversing back up the tree is usually fine to do. However you can select a node by it's id if you want.

    <xsl:variable name="rootNode" select="umbraco.library:BeyXmlNodeById(xxx)" />
  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Nov 10, 2009 @ 17:26
    Sebastiaan Janssen
    1

    There really shouldn't be a problem with traversing back up the nodes, unless you have a really, really long path maybe.

    To go all the way back up to the root, I use: 

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

    But usually I want to stay within the root of the current site (as I am using the multisite feature of Umbraco a lot), then I use:

    <xsl:variable name="currentSiteRoot" select="$currentPage/ancestor-or-self::node" />
  • GI 4 posts 24 karma points
    Aug 21, 2012 @ 15:58
    GI
    0

    This is great stuff, I know I'm a little late in this, and wanted to know if you have 2 sites in umbraco how can I show 2 navigations on one page?

     

    Thanks GI

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Aug 23, 2012 @ 10:52
    Chriztian Steinmeier
    0

    Hi GI,

    The best way for you to get a good answer would be to post it as a new question, since this has already been marked as solved. Others may also do a search for something with two navigations and thus, would much easier find that question too.

    Rest assured, Someone will hop in with an answer as soon as you've posted it :-)

    /Chriztian

Please Sign in or register to post replies

Write your reply to:

Draft