Copied to clipboard

Flag this post as spam?

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


  • Jannik Nilsson 38 posts 81 karma points
    Jun 07, 2010 @ 10:35
    Jannik Nilsson
    0

    GetXmlAll() also gets items from the trash

    When I call umbraco.library:GetXmlAll()//node [@nodeTypeAlias='UserComment'] the code also gets the items in the recyle bin.

    Is there a way to prevent that?

  • Sebastiaan Janssen 5061 posts 15544 karma points MVP admin hq
    Jun 07, 2010 @ 10:46
    Sebastiaan Janssen
    0

    Yes: by not using GetXmlAll! :-)

    Try:

    <xsl:variable name="allUserComments" select="$currentPage/ancestor::node//node [@nodeTypeAlias='UserComment']" />
  • Jannik Nilsson 38 posts 81 karma points
    Jun 07, 2010 @ 13:12
    Jannik Nilsson
    0

    Looks promising, but strangely enough I dont get any returns. Back into the trench to debug :)

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jun 07, 2010 @ 13:14
    Dirk De Grave
    1

    think you first need to go to the root node instead of just the ancestor node

    <xsl:variable name="allUserComments" select="$currentPage/root::node//node [@nodeTypeAlias='UserComment']" />

    Hope this helps.

     

    Regards,

    /Dirk

  • Jannik Nilsson 38 posts 81 karma points
    Jun 07, 2010 @ 14:19
    Jannik Nilsson
    2

    Thanks both of you, this did the trick:

     

    <xsl:variable name="allUserComments" select="$currentPage/ancestor-or-self::node//node [@nodeTypeAlias='UserComment']" />

  • Sebastiaan Janssen 5061 posts 15544 karma points MVP admin hq
    Jun 07, 2010 @ 15:03
    Sebastiaan Janssen
    0

    Dirk: By using "root" you'd not be able to create a multisite solution that seperates the content of the different sites, that's why I always use "::node".

    Jannik: ah, I see, I did leave out the "or-self" part, glad you found the solution!

  • 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