Problem/Motivation
Hello,
While retrieving the contents from a JSON, some of these contens can be tags or other categorization type fields.
However all the filters are a textfield input and we may want to use a simple select to filter the view.
Proposed resolution
Created a patch with an exposed form style that changes the type of the exposed field to a select with the available field options.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | Views-json-source-json-select-options--3345790-4.patch | 15.85 KB | thony1199 |
| #3 | views-json-source--json-select-options--3345790-3.patch | 10.35 KB | tmiguelv |
Comments
Comment #2
tmiguelv commentedPlease review
Comment #3
tmiguelv commentedI've added and option to select the type of widget it will use (checkbox, radios or select), a collapsible details element and multiple values support
Comment #4
lunazoid commentedThank you! I am implementing a view where filtering with select options would be necessary, and this does work very well! One thing I had to change however was in your switch condition for the filter, there is no default for the "select" option when it is neither collapsible nor multiple. It seems like we can get rid of the "elseif" and make that a default, and it will work well.
Comment #5
anblee commentedHi, thanks for this patch, however I cannot apply the patch. Maybe I'm doing something wrong? This is referencing the 3345790-3.patch
UPDATE : I was able to add the patch.
Comment #6
thony1199They recently updated to version 2.0.2 and the patch stopped working, so I adjusted it a bit, to have it for that version of the module