Count childnodes with id selected in MultiNodeTreePicker
Hello Umbracoholics,
I'm cracking my brain on this one: I want to get a list of items selected(from the childnodes) in the multinodepicker and the problem part is that I can't count this selected items. This list is to filter the childnodes later on.
If I understand your structure correct, I think this will do the trick - replace the first for-each with this chunk:
<xsl:for-each select="$plaatsnaam/*[@isDoc][@id = $plaatsnaampicker]">
<xsl:variable name="plaatsId" select="@id" />
<li>
<xsl:value-of select="@nodeName" />
<xsl:text>(</xsl:text>
<!-- Count the number of child nodes that point to this place in their pickers -->
<xsl:value-of select="count($currentPage/*[@isDoc][plaatsnaam//nodeId = $plaatsId])" />
<xsl:text>)</xsl:text>
</li>
</xsl:for-each>
You could probably do something similar in the second part to count the objecttypes too ...
Count childnodes with id selected in MultiNodeTreePicker
Hello Umbracoholics,
I'm cracking my brain on this one: I want to get a list of items selected(from the childnodes) in the multinodepicker and the problem part is that I can't count this selected items. This list is to filter the childnodes later on.
So it must look like this:
City:
- New York (3)
- Amsterdam (2)
- Paris (5)
Object type:
- Home
- Office
- Garden
My xslt up to now:
Hi Niels,
If I understand your structure correct, I think this will do the trick - replace the first for-each with this chunk:
/Chriztian
Yes, thanks Chriztian! That did the trick indeed! For the second part it works out fine too.
is working on a reply...