Problems, need help? Have a tip or advice? Post it here.
4 posts Page 1 of 1
Hello everyone,

I tried to make opt_values for a checkbox editable field dynamic with the following code:

Code: Select all
<cms:template title='Contacts' clonable='1' icon='person'>

    <cms:field 'testing'>
    <cms:pages masterpage="parametres.php">
    <cms:editable type='checkbox' name='groupes' opt_values='<cms:show noms_groupes />' />


The "parametres.php" page has a simple input text field named "groupes". Inside that text field, I have entered "Test1 | Test2". What I want to do, is to show whatever is inside that "groupes" text field, as opt_values for the "groupes" editable on the Contacts page.

I have searched on the forum for a way to do this, and I cannot find anything that helped for now.
I would of done it with relation fields, but I must be able to let my client edit the options of a checkbox list, because I must be able to select multiple options at once.

Of course, if there's a way to use "relation" editables as checkboxes instead of dropdown menus, so that I can select multiple relations at once, that would be perfect, but I don't think it's possible.

Any idea?

Thanks a lot!

I suggest you please try using the method discussed in the following post -

Hope it helps
Once again, you helped me achieve what I needed to do :)

I used Repeatable Regions instead of a simple input text field. So that way, my client will be able to add his own "tags".

What I did is creating an html document with the following content (placed in the Snippets folder of Couch):

Code: Select all
<cms:pages masterpage='parametres.php'>
   <cms:show_repeatable 'noms_groupes_repeat' >
<cms:show noms_groupes  /> | </cms:show_repeatable>

Then, on the page where I needed to display those checkboxes, I added the following line:
Code: Select all
<cms:editable name="contact_group" label="Groupe" opt_values='groupes.html' dynamic='opt_values' type='checkbox' />

It worked perfectly :)
I am glad it helped :)
4 posts Page 1 of 1

Who is online

In total there are 5 users online :: 0 registered, 0 hidden and 5 guests
(based on users active over the past 5 minutes)

Users browsing this forum: No registered users and 5 guests