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 want to count the number of records of shops within a certain category (= variable cntshops), but for some reasons the result is equal to 0. What could be the problem?
The field w_cat is a multinode treepicker of categories.
<xsl:for-each select="umbraco.library:GetXmlNodeById(1124)/* [name() = 'Categorie']"> <xsl:sort select="@sortOrder" order="ascending" data-type="number"/> <Categorie> <xsl:variable name="catid"> <xsl:text disable-output-escaping="yes">,</xsl:text><xsl:value-of select="@id"/><xsl:text disable-output-escaping="yes">,</xsl:text> </xsl:variable> <xsl:variable name="cntshops" select="count(umbraco.library:GetXmlNodeById(1132)//* [name() = 'Winkel' and contains(concat(',',w_cat,','),$catid)])"/> <xsl:attribute name="Aantal"><xsl:value-of select="$cntshops"/></xsl:attribute>
</Categorie>
</xsl:for-each>
grts,
Kim
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
Count number of nodes within for each
Hi,
I want to count the number of records of shops within a certain category (= variable cntshops), but for some reasons the result is equal to 0. What could be the problem?
The field w_cat is a multinode treepicker of categories.
<xsl:for-each select="umbraco.library:GetXmlNodeById(1124)/* [name() = 'Categorie']">
<xsl:sort select="@sortOrder" order="ascending" data-type="number"/>
<Categorie>
<xsl:variable name="catid">
<xsl:text disable-output-escaping="yes">,</xsl:text><xsl:value-of select="@id"/><xsl:text disable-output-escaping="yes">,</xsl:text>
</xsl:variable>
<xsl:variable name="cntshops" select="count(umbraco.library:GetXmlNodeById(1132)//* [name() = 'Winkel' and contains(concat(',',w_cat,','),$catid)])"/>
<xsl:attribute name="Aantal"><xsl:value-of select="$cntshops"/></xsl:attribute>
</Categorie>
</xsl:for-each>
grts,
Kim
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.