I am pulling a list of values (topics) from form 1 to form 2 via a lookup field and presenting the values in form 2 as checkboxes and then displaying the values (as hyperlinks) in a view. However, I cannot find a way to loop through the (checkbox) values in a way that will allow me to construct a custom URL specific to each value.
The closest thing I can find is [x sep=", " ] but (as far as I know) that will not allow variable use within. Is there some way to do this similar to the [foreach] that can be used for repeaters?
Simple Overview of my Forms / Views
Form 1 = Topics
Form 2 = Courses with Topic field pulled from Form 1 values as checkboxes in Form 2.
Form 2 View = Loop through Topic values checked in Form 2 and construct a custom hyperlink for each that links back to the topic view to show courses for that topic.
Please let me know if this is possible or if there is another way to achieve the same thing. Thanks!! - Patrick
There is no way to natively loop through a multi-select checkbox in a view. I would create a custom shortcode to display the values as hyperlinks. The thing to be aware of is multi-checkbox values are stored in the database as serialized arrays. They need to be unserialized before you can loop through the array. If a checkbox only has one selection, it is stored in the database as plain text, not a serialized array.
Thanks Victor!
Please login or Register to submit your answer