Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
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?
Yes: by not using GetXmlAll! :-)
Try:
<xsl:variable name="allUserComments" select="$currentPage/ancestor::node//node [@nodeTypeAlias='UserComment']" />
Looks promising, but strangely enough I dont get any returns. Back into the trench to debug :)
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
Thanks both of you, this did the trick:
<xsl:variable name="allUserComments" select="$currentPage/ancestor-or-self::node//node [@nodeTypeAlias='UserComment']" />
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!
is working on a reply...
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.
Continue discussion
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?
Yes: by not using GetXmlAll! :-)
Try:
Looks promising, but strangely enough I dont get any returns. Back into the trench to debug :)
think you first need to go to the root node instead of just the ancestor node
Hope this helps.
Regards,
/Dirk
Thanks both of you, this did the trick:
<xsl:variable name="allUserComments" select="$currentPage/ancestor-or-self::node//node [@nodeTypeAlias='UserComment']" />
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!
is working on a reply...
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.