Search/filter question

5 posts by 2 authors in: Forums > CMS Builder
Last Post: November 21, 2016   (RSS)

By mizrahi - November 17, 2016

I am working a list filter for a client and I'm not sure how to accomplish something.

I have a Section (grades) that includes a multl-value checkbox list (melt_types). In the CMS the administrator can select as many melt_types as they want for each grade. 

On the live site, I want the site users to be able to filter the list of grades by as many melt_types as they want.

I have filtering via the URL working one for melt_type...
/grades.php?melt_type=1

And I tried this, but it doesn't quite work, because it filters down to the grades that have both melt types selected...
/grades.php?melt_type=1&melt_type=2

I need a method that results in an OR condition, not AND.

Possible? 

By mizrahi - November 17, 2016

Any thoughts on this?

By ross - November 17, 2016

Hi there.

Thanks for posting.

What you will need to do is create a custom "WHERE" and use that to filter the results. 

The custom "WHERE" will be where you can use the "OR" searches:

"where" => "melt_type = 1 OR melt_type = 2 OR melt_type = 3"

How comfortable are you with custom "WHERE"?

Let me know what you think.

Thanks!

-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/

By mizrahi - November 18, 2016 - edited: November 18, 2016

I am familiar and comfortable with the custom WHERE, but I'm not sure how to utilize it in this situation. How would I inject in custom criteria for the WHERE from the URL? Attached is a screen grab of my page, in case that's helpful.  

Attachments:

grades.png 286K