I am sure user needs not only check what he needs, but also add/remove options with ease. This can be achieved via dynamic generation of options in a checkbox. Let's see how we can do that.
We'll have to set up the list somewhere once and make it editable for admin. Values from that list must appear as checkboxes in each cloned page. Define your checkbox editable in this fashion -
- Code: Select all
<cms:editable
name="my_options"
label="Options" desc="Check all applicable"
dynamic='opt_values'
opt_values='my_options.inc'
type='checkbox'
/>
<cms:globals>
<cms:repeatable name='options' label='All options' desc='Example: ABS, Airbag etc. One option per row!' >
<cms:editable type='text' name='option' />
</cms:repeatable>
</cms:globals>
To explain the code - we are using a (undocumented) parameter 'dynamic' and telling it that 'opt_values' is the field that instead of containing the usual static value, actually needs to be filled dynamically by using the snippet that is its value.
The value in 'opt_values' ('my_options.inc') is executed by Couch and the result is placed as the computed value of 'opt_values'.
If your CouchCMS version is at least 2.1 and you have studied its release notes (
viewtopic.php?f=5&t=11105) you'll also recognize the 'Globals' part. Go to 'Manage globals' section for that template and add a couple of options -

- options
- 2019-01-13-001.png (11.06 KiB) Viewed 2059 times
Next, create a snippet 'my_options.inc' in your snippets folder (couch/snippets by default). Place the following code in it and it will be executed upon each load of cloned page in backend filling our checkboxes editable with options dynamically -
- Code: Select all
<cms:get_global 'options' >
<cms:show_repeatable 'options'>
<cms:show option /> ||
</cms:show_repeatable>
</cms:get_global>

- checkboxes
- 2019-01-13-002.png (3.37 KiB) Viewed 2059 times
Display code is also pretty simple -
- Code: Select all
<div class="row">
<div class="info">
<span class="name">Options:</span>
<span class="input">
<ul>
<cms:each my_options as='option'>
<li><span><cms:show option/></span></li>
</cms:each>
</ul>
</span>
</div>
</div>
Does it help?
P.S. One possible issue with dynamic approach - if admin removes one of the options in globals, it will be hid from checkboxes as expected, but not from the saved pages in database. I.e. if there was an option 'Diesel' and some cars had it listed, then if it is removed from the main list, the cars still show 'Diesel' among the options, because list only affects the visibility of options in checkboxes. Admin must re-save such pages to persist the change.