Confused: Is there XSLT syntax to pull out which items were checked?
Datatype - Checkbox list attached to Member Profile
If I look in ContentXML I see a list of ALL the checkbox items. In cmsPropertyData I can see in here are the items that were selected ie 1157, 1158 etc.
<xsl:variable name="prefsToSplit" select="umbraco.library:GetCurrentMember()/data [@alias='SpecialtyWatch']"/> will give a list of all "SpecialtyWatch" items.
Have a look at the umbraco library functions split and getPreValueAsString
Split will allow you split a comma seperated string like a list of prevalue ids and it will return a chunk of xml that represents the values. You can then iterate through those ids and use GetPreValueAsString to get the text value.
Peter thanks heaps for your posts. I am even more confused now....
If I now do the following the "checked" items now display correctly. I could have sworn I did the same yesterday and it was spitting out all the items not just the checked ones. Anyhow seems to be working which is good.
Okay I found the issue. If I save the checkbox from inside umbraco control panel it works as expected. If I do it from the front end its saving correctly but its not republishing correctly so the changes are reflected client side.
Retrieve Selected Values in Checkbox List + XSLT
Confused: Is there XSLT syntax to pull out which items were checked?
Datatype - Checkbox list attached to Member Profile
If I look in ContentXML I see a list of ALL the checkbox items. In cmsPropertyData I can see in here are the items that were selected ie 1157, 1158 etc.
<xsl:variable name="prefsToSplit" select="umbraco.library:GetCurrentMember()/data [@alias='SpecialtyWatch']"/> will give a list of all "SpecialtyWatch" items.
Thanks in advance.
Hi
Have a look at the umbraco library functions split and getPreValueAsString
Split will allow you split a comma seperated string like a list of prevalue ids and it will return a chunk of xml that represents the values. You can then iterate through those ids and use GetPreValueAsString to get the text value.
something like this
Hope that helps.
Peter
also heres the reference to those two Library Methods.
http://our.umbraco.org/wiki/reference/umbracolibrary/split
http://our.umbraco.org/wiki/reference/umbracolibrary/getprevalueasstring
:)
Peter thanks heaps for your posts. I am even more confused now....
If I now do the following the "checked" items now display correctly. I could have sworn I did the same yesterday and it was spitting out all the items not just the checked ones. Anyhow seems to be working which is good.
Thanks for your help.
Okay I found the issue. If I save the checkbox from inside umbraco control panel it works as expected. If I do it from the front end its saving correctly but its not republishing correctly so the changes are reflected client side.
Thanks,
Matthew
Very useful advice Peter Gregory with Split function - exactly what I was looking for! Thanks
is working on a reply...