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

I'm trying to customize the opt_values for a template so when displayed, show an image rather than text. Is it possible to embed html in the opt_values?

Code: Select all
<cms:editable name="checkboxes" label="Checkbox" desc="Check all applicable" opt_values="Option1=<img src='option1.jpg'> | Option2=<img src='option2.png'>" type='checkbox' />


This is how I've implemented it. The options show up in the admin panel, but when I try to save it reverts back to being unchecked.

Thanks,
Sam
Sam, I think instead of setting the entire HTML markup as value, we should set only the image name (or its path) e.g.
Code: Select all
<cms:editable name="checkboxes" label="Checkbox" desc="Check all applicable" opt_values="Option1=option1.jpg | Option2=option2.png" type='checkbox' />

The required markup can be easily reconstructed on the frontend using the selected values as follows
Code: Select all
<cms:each checkboxes as='my_image' >
    <img src=my_image>
</cms:each>

Does this help? Please let us know.

Thanks.
Yes this does help. Originally I wanted to have the full HTML in there so I could also include alt text based on the picture, but I think this will be sufficient for me for now.

Thanks again!

Sam
3 posts Page 1 of 1