I am currently trying to get some news filters done, but I struggle to filter for more than one value.
I do NOT want to filter multiple parameters (e.g. year, topic, author). Instead, I want to select several values that are tied to one parameter.
My approach so far was, to add the single keyword URL to the labels of the checkboxes as some kind of fallback if javascript cant be loaded for any reason. And then in a second step, disabling the href, but collecting the parameters of all the checked values and building a new link that is loaded when clicked on submit. And then seperate it again in the controller to get the values for my Kirby tags.
This seems incredible clunky and I was wondering if there is a better and maybe very different approach for this that I didn’t think of.
Thanks for reading, all suggestions are appreciated!
This has nothing to do with Kirby. That’s the URL that is produced by the form, no matter if inside Kirby or a standard HTML page.
To create a comma separated list instead of repeating tags, you probably have to use some JavaScript, but when I google this, most of the stuff I find is ASP.net related.
The [] is PHP specific, to read the values into an array.