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
I have a checkbox list that when multiple values are selected the values display as:Project type: Fitout,Refurbishmenthttp://isis.brandtoolbox.com.au/projects/projects/office/abc-radio-triple-j.aspx (check Project type:)
I tried using umbraco.library:Replace to change the comma to a comma and space. (',' , ', ') or (',' , ', ')
But can't get it to work, can anyone help?
Cheers,JV
This should help you: http://our.umbraco.org/wiki/reference/umbracolibrary/split
Do this:
<xsl:variable name="selectedValues" select="umbraco.library:Split($commaSeperatedList,',')" /> <xsl:for-each select="$selectedValues//value"> <xsl:value-of select="current()" /> <xsl:if test="position() != last()">, </xsl:if> </xsl:for-each>
Hi JV
You should actually be able to do this with the Replace-extension. Try this:
<xsl:variable name="comma"><![CDATA[,]]></xsl:variable><xsl:variable name="commaSpace"><![CDATA[, ]]></xsl:variable><xsl:value-of select="umbraco.library:Replace($currentPage/aliasOfCheckbox,$comma,$commaSpace)" />
/Kim A
Ohh, actually when I think about it, shouldn't this work as well:
<xsl:variable name="values" select="concat($currentPage/aliasOfCheckbox,',')"/><xsl:value-of select="umbraco.library:Replace($values, ',', ', ')" />
In my first example, you might need to use the concat method also.
Both work.. I like Kim's.. it's easier for the task
Thanks Kim and Daniel!
I went with Kim's solution, and it's working perfectly.Cheers!
You are welcome JV. Great to hear that you got the problem solved!
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Checkbox list values replace comma with comma and space
I have a checkbox list that when multiple values are selected the values display as:
Project type: Fitout,Refurbishment
http://isis.brandtoolbox.com.au/projects/projects/office/abc-radio-triple-j.aspx (check Project type:)
I tried using umbraco.library:Replace to change the comma to a comma and space. (',' , ', ') or (',' , ', ')
But can't get it to work, can anyone help?
Cheers,
JV
This should help you: http://our.umbraco.org/wiki/reference/umbracolibrary/split
Do this:
Hi JV
You should actually be able to do this with the Replace-extension. Try this:
/Kim A
Ohh, actually when I think about it, shouldn't this work as well:
In my first example, you might need to use the concat method also.
/Kim A
Both work.. I like Kim's.. it's easier for the task
Thanks Kim and Daniel!
I went with Kim's solution, and it's working perfectly.
Cheers!
You are welcome JV. Great to hear that you got the problem solved!
/Kim A
is working on a reply...