Ability to loop over all items in Checkboxes, Multi Select, Radio Buttons, Select Dropdown, and Selectable Buttons fieldtypes #2870
Replies: 4 comments
-
|
This does indeed come up in support. Not a ton, but frequently enough that it's a thing. |
Beta Was this translation helpful? Give feedback.
-
|
I think we would need new tag for this (ex. |
Beta Was this translation helpful? Give feedback.
-
|
I've come across the perfect use case for this today. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
EE has a number of fieldtypes which consist of a list of value:label pairs: Checkboxes, Multi Select, Radio Buttons, Select Dropdown, Selectable Buttons. Using template code, within the
{exp:channel:entries}tag, it's possible to loop over the chosen items for each of these fieldtypes for any channel entry. However, it's not currently possible, using template code, to loop over all of the items in the field itself, outside of the{exp:channel:entries}tag.There are lots of situations in which looping over all of the available items in a field using one of these fieldtypes, can be useful in template code outside of a channel entries tag: to generate menu items; navigation controls, content filters, etc. This type of general facility exists for categories, using the
{exp:channel:categories}tag, but there's no analogous facility for the various value:label fieldtypes. This feels like an obvious gap.Beta Was this translation helpful? Give feedback.
All reactions