I used something like this earlier, when I used the multipleContentPicker, where the id's where seperated by commas. You could try to write out the $split to see how the values are split up in some fine XML.
In the new template, we can make a new variable called $itm. This variable should contain the XML from the node with the right id. And the template will be looped for every id in your $split. A good idea is to make a textarea and print out the $itm, to check that it contains the right XML. Like this:
Actually you can use another selection in your apply-templates, to make sure that you're not looping trhough the empty <value>-tag at the end. Try this one instead:
<xsl:apply-templates select="$split//value[./text() != '' and umbraco.library:GetXmlNodeById(./text())/@nodeName != '']"/>
Your other template should still match "value", so no change there.
Looping through all values of a propertyTypePickerMultiple in XSLT
I'm using a propertyTypePickerMultiple as Macro Paramater,
but how do I split all these properties so that I can get the values of these properties?
Hi Bram
I can't remember xich character that seperates the values, but maybe you could something like this:
I used something like this earlier, when I used the multipleContentPicker, where the id's where seperated by commas. You could try to write out the $split to see how the values are split up in some fine XML.
/Kim A
Thanks Kim,
How do I loop through the items of 'split now?
this returns just the whole string all the items
try:
Try this:
In the new template, we can make a new variable called $itm. This variable should contain the XML from the node with the right id. And the template will be looped for every id in your $split. A good idea is to make a textarea and print out the $itm, to check that it contains the right XML. Like this:
This textarea shall of course be placed inside the <xsl:template match="value">
Does it make sense?
/Kim A
nice bl_ndp_lot but that return only the first item.
It use thes properties:
the properties: siteDescription, siteName, pageAlt, pageTitle
and I get this response:
- siteDescription
- siteDescription
- siteDescription
- siteDescription
- siteDescription
with this XSLT
except of the fact that I return now 5 value (the for values I selected + one empty one) the solution of Kim works
Sounds great Bram.
Actually you can use another selection in your apply-templates, to make sure that you're not looping trhough the empty <value>-tag at the end. Try this one instead:
Your other template should still match "value", so no change there.
Glad I could help :)
/Kim A
is working on a reply...