Count-Statement Syntax Options
electricric
Posted: Wednesday, September 03, 2008 10:46:37 AM
Rank: Newbie

Joined: 8/25/2008
Posts: 16
Location: Germany

Hello,


i would like my script to count all child nodes of the parent with a given property (in this case documents with the property sidebarbox=19).
I want to test if there are pages beneath which fit into this scheme.

My Code looks like this:

Code:

<xsl:when test="count($currentPage/../node [@alias = 'sidebarbox' = '19']) &gt; 0">


It doesn't produce an obvious error, but it never finds a matching document either, so i
guess there's something wrong with the syntax.

Any help would be appreciated,


Greetings,
Electric-Ric
Dirk
Posted: Wednesday, September 03, 2008 11:01:14 AM

Rank: Umbracoholic

Joined: 9/27/2007
Posts: 1,136
Location: Belgium
Hi Electric-Ric,

Give this one a try:

Code:
<xsl:when test="count($currentPage/node [string(./data [@alias='sidebarbox']) = '19']) &gt; 0">


Hope that helps,
/Dirk


level 1 & 2 certified - umbraco MVP 2008/2009 - umbraco blog at netaddicts.be - working on an integrated forum4umbraco
electricric
Posted: Wednesday, September 03, 2008 11:49:28 AM
Rank: Newbie

Joined: 8/25/2008
Posts: 16
Location: Germany
Your code works and again i've learned a little more.

Thank you once again, Dirk! Applause


Greetings,
Electric-Ric
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.