Copied to clipboard

Flag this post as spam?

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


  • Tom Maton 387 posts 660 karma points
    Sep 03, 2010 @ 12:11
    Tom Maton
    0

    Get all nodes by node type 4.5.2

    Hi All,

    This is not really a problem but l just for advice and best practice.

    I'm currently trying to retrieve all nodes by a particular node type so have done this

    umbraco.library:GetXmlAll()//*[@isDoc]/EventItem

    As the nodes can be dotted around the site under different node so thought this would be the best way but not sure if its the quickest.

    Any advice,pointers much appreciated

    Tom

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Sep 03, 2010 @ 12:17
    Chriztian Steinmeier
    2

    You should be able to do that without calling that method:

    <xsl:variable name="events" select="$currentPage/ancestor::root//EventItem" />

    This will get all EventItem nodes scattered around the solution - if you need to filter only those in the current site (if you're doing multiple sites, having the root of each site at level 1) do this:

     <xsl:variable name="events" select="$currentPage/ancestor-or-self::*[@level = 1]//EventItem" />

    /Chriztian

  • Tom Maton 387 posts 660 karma points
    Sep 03, 2010 @ 17:08
    Tom Maton
    0

    Hi Chriztian,

    Cheers, thought there would of been a better way.

    Plus would of helped if I spelt nodes correctly as it may of worked early... So glad its the weekend.

    Thanks

    Tom

Please Sign in or register to post replies

Write your reply to:

Draft