Selection Box for Different Category Filtering (Public Output)

4 posts by 2 authors in: Forums > CMS Builder
Last Post: May 25, 2017   (RSS)

By mark99 - May 24, 2017 - edited: May 24, 2017

Is there a simple way to filter my public products list output via the 'where' call between two different fields, such as via a checkbox that readers could select / click?

At present I call the category for my products list like so:

    'where'         => " category LIKE '%Ultrafast Broadband%' ",

However sometimes I have to make a separate list in order to filter the category output by a second field, which I do by using a different 'where' call:

'where'         => " category LIKE '%Ultrafast Broadband%' AND (uk_network_availability LIKE '%Significant National Coverage%' OR uk_network_availability LIKE '%Patchy National Coverage%') ",

I find it wasteful to have to make two separate listing pages for this and wondered if there's a simpler way to do it on the same page via a selection box or something? So the list would default to one of the two' where' calls and then reload with the other when a visitor clicks a checkbox. Any ideas?

By mark99 - May 25, 2017

Thanks Jerry. Think I'll have to take some time to try and get my head around that one as my PHP knowledge is fairly basic but I sort of understand what it's trying to do, although I'm not yet sure how to adapt it to my system.

By gkornbluth - May 25, 2017

Hope it works for you.

The Cookbook has some tutorials also

Jerry

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php