Problems, need help? Have a tip or advice? Post it here.
4 posts Page 1 of 1
Hello!
Let me also say how much Couch is awesome! I love every bit of it and the service is more than top notch!
I am creating a template with checkbox and the opt_values are dynamic.

What needs to happen is whatever checkbox is checked, that value becomes the class. So the output of whatever is checked needs to have a space separating each word.
So, say there are 4 options available and user chooses 3 of them. Then <li class=<cms:show checkbox_output />"> should be a list item with those 3 checkboxes as the classes.
The problem is that when the checkboxes list out, they all have a pipe ( | ) after them. This won't allow the classes to be listed correctly.

I have searched the forum and looked furiously on ways to strip off this pipe from the output. Is that even a possibility?

Here is the code for my dynamic population of the checkbox:
Code: Select all
<cms:pages masterpage='port_cat.php' >
    || <cms:show k_page_title  /> = <cms:show k_page_name />
</cms:pages>


The 2 pipes in front allow for each checkbox choice to be in its new line. However, I have tried to get rid of the pipes and that doesn't work, either.


Is there a way to strip off the pipe from the output in this case?
Hi :)
Thank you very much for your kind words.

Regarding the problem you have -
one can use cms:each to list each of the values selected in the checkboxes (http://docs.couchcms.com/tags-reference/each.html).

Please try the following -
Code: Select all
<li class="<cms:each checkbox_output sep='|'><cms:show item /> </cms:each>">

Hope it helps.
That is absolutely what I needed. Now it works as it should. Thank you so much KK. I don't know how or when you ever get sleep, but you deserve it. :D :D :D
You are always welcome :)
I'm glad I could help.
4 posts Page 1 of 1