Forum

Thread tagged as: Question

Template Checkbox Group

I'm pretty sure this has been asked before, but didn't see it in a search.

In perch templates, is it possible to organize checkboxes like you do with radio buttons?

Thanks again

Nicholas Nelson

Nicholas Nelson 0 points

  • 6 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

I'm not sure what you mean, what output are you trying to achieve?

Well, with the radio button you can add as many option/value pairs as you like. Checkboxes, according to the docs, offer just one option/value pair. So each checkbox is a new "line-item" in the editor panel.

Im my particular case, I am working with a sidebar. In the sidebar I have a perch repeater for button links. I'm looking to give the editor the option of choosing which pages each button appears on. The radio buttons only allow one option to be chosen of course, same with a select-box. So I figure I need checkboxes. However I was hoping the checkboxes could be created like radio buttons are. All the options under one label. Does this make sense?

Drew McLellan

Drew McLellan 2638 points
Perch Support

We don't have a checkbox group field type currently. I dare say one could be created.

The sticky point is the templating of the output. This would presumably need to work like categories, using a tag pair and contained template code for each item to output.