0

I've a Channel Field, I create a field-pack drop-down list that works great on the Article page back-end.

Now I need to get all values of that list and output it into the article temple if i do {cuisine:label} it will give me the selected value as set on the back-end when the article was created. But I need all values not only the selected one.

How can I get the full list of that particular channel field - drop down to output it into a template?

The rational is that in the front-end I need to recreate that list and then use those values for search queries. Hence I need value:label pairs so i dont have to replicate the data.

0

I don't known your complete use case, but a drop down isn't really the right field type to go with, I suspect. You can't output it as you want, and would have to use some front-end jQuery-izing to take the field and convert it into a list.

I would use the Checkboxes field. Ref:

http://docs.pixelandtonic.com/fieldpack/fieldtypes/checkboxes/tags.html#ol-and-ul-tags

That will allow you to output your values as a list. But as a side note... ever hear of fusion cuisine? :p you might want to allow multiple selections for that field on a content level, because half the world does fusion.

  • What I am trying to do is create a list of all those label:values to use in a sort by/search box for the front-end user. I don't want to have to repeat that list-data manually – Jonathan Thurft Oct 28 '15 at 14:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.