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
Hi,
I was wondering how I could count every node in my site that has the doc type 'TextImageData'?
Hi Philip,
You should be able to do it like this:
<xsl:variable name="documentCount" select="count($currentPage/* [name() = 'TextImageData' and string(umbracoNaviHide) != '1'])"
This is assuming you're using the new XML schema. Hope this helps...
You're actually pretty close :-)
If you want to count all occurences, regardless of visibility (not accounting for umbracoNaviHide), do something like this:
<xsl:variable name="siteRoot" select="$currentPage/ancestor-or-self::*[@level = 1]" /> <xsl:value-of select="count($siteRoot//TextImageData)" />
Using $siteRoot keeps the count within the current site - if you're not having multiple sites in the installation, you can replace *[@level = 1] with root, to get the total count.
/Chriztian
EDIT: Nevermind, found it. Thanks again!
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
Can I count every node in my site that has a particular doc type?
Hi,
I was wondering how I could count every node in my site that has the doc type 'TextImageData'?
Hi Philip,
You should be able to do it like this:
This is assuming you're using the new XML schema. Hope this helps...
Hi Philip,
You're actually pretty close :-)
If you want to count all occurences, regardless of visibility (not accounting for umbracoNaviHide), do something like this:
Using $siteRoot keeps the count within the current site - if you're not having multiple sites in the installation, you can replace *[@level = 1] with root, to get the total count.
/Chriztian
EDIT: Nevermind, found it. Thanks again!
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.