Copied to clipboard

Flag this post as spam?

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


  • Philip 13 posts 33 karma points
    Oct 21, 2010 @ 14:54
    Philip
    0

    Display list of nodes on every page of site?

    I'm trying to find a way of displaying a list of nodes on every page of my site. The nodes I want to display sit under a specific node. Is there a way I can show every node under the specified node ID?

    Thanks for any help.

  • Anders Rørvik 25 posts 47 karma points
    Oct 21, 2010 @ 14:59
    Anders Rørvik
    0

    Yes,

    if you're using the nodefactory you can query a certain node for its children, and iterate over them, a quick example:

    Node _node = new Node(id);
    foreach (Node _n in _node.Children) {

    // do stuff

    }

     

     

  • Rich Green 2246 posts 4008 karma points
    Oct 21, 2010 @ 15:33
    Rich Green
    0

    For 4.5

    <!--Loop children from certain node-->
    <xsl:for-each select="umbraco.library:GetXmlNodeById('18616')/* [@isDoc][string(umbracoNaviHide) != '1']">
    <li>
    <a href="{umbraco.library:NiceUrl(@id)}">
    <xsl:value-of select="@nodeName"/>
    </a>
    </li>
    </xsl:for-each>

    Prior to 4.5

    <!--Loop children from certain nodeà

    <xsl:for-each select="umbraco.library:GetXmlNodeById('18616')/node [string(data[@alias='umbracoNaviHide']) != '1']">                   

    <li>                                            

    <a href="{umbraco.library:NiceUrl(@id)}"><xsl:value-of select="@nodeName"/></a>

    </li>

    </xsl:for-each>

     

    You will need to update the node id to the one you need.

    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