Forum for discussing general topics related to Couch.
6 posts Page 1 of 1
Hi I have been trying to figure out how to change the checkbox display separation to be by spaces rather than Pipes or any other character.

Please let me know if anyone else has run into this or may have a solution.
Hi,
checkbox display separation
Sorry couldn't get you. The checkboxes will never be displayed using the pipes. The pipes are meant only to let Couch know the separation between values.

Have I misunderstood the question? Please let me know.
I just want the display when using <cms: project_type /> to display the following


current display from couch: james | jayson | paul

Desired display: james jayson paul
OK. got it.

Please try the following.
Code: Select all
<cms:each project_type sep='|' >
    <cms:show item />&nbsp;
</cms:each>

We can use the cms:each tag to display the selected values of a checkbox in any desired way. Please see http://www.couchcms.com/docs/tags-reference/each.html

Hope this helps.
Hi! I realize this post is quite old, but I am trying to do the same thing, except I need the space printed right within the code. I am doing a gallery which can be sorted by category, and I need each of the options to be printed with nothing but a space separating them, like so:

Code: Select all
 <div class="realestate foodbev commercial advertising" </div> 


Here is my code:

Code: Select all
 
<cms:editable name="my_categories" label="Categories" desc="Check all applicable"
        opt_values='product  |  people  |  realestate |  advertising |  location | foodandbev | retouching'
        type='checkbox'
      />


I tried your solution above, but can't get the pipes to disappear, and can't have & nbsp showing in my code. Just a space. Any help you could give me with this would be really appreciated!
</code girl>
Hi @graphicfixations!

Please try the following -
Code: Select all
<div class="<cms:each my_categories sep='|'><cms:show item /> </cms:each>">
    <!-- div contents here -->
</div>

It displays something like this -
Code: Select all
<div class="product advertising foodandbev ">
    <!-- div contents here -->
</div>

I think that is what you are looking for.
Explaining the code, it is a simple variation of the original post with the '&nbsp;' being substituted by ' ' (that is a physical space character). Point to note is that Couch will faithfully output whatever you place between the tags (in this case it is a single space just after <cms:show item />).

Hope it helps.
6 posts Page 1 of 1