ListIt2 smart filtering

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
User avatar
tophers
Forum Members
Forum Members
Posts: 218
Joined: Thu Jun 07, 2007 7:25 pm
Location: Calgary, Alberta, Canada

ListIt2 smart filtering

Post by tophers »

I'm wondering if it’s possible to have the filtering in ListIt2 look at the selections made in one dropdown and reduce the options in another? The idea is to eliminate the possibility of choosing a combination with zero matching results. Something like this:

Dropdown One (fruit):
Apple
Banana
Orange

Dropdown Two: (color):
Red
Green
Yellow
Orange

If you select 'Red' from Dropdown Two, then Dropdown One would only show 'Apple', since it's the only one with matching criteria.

I've seen something similar in a post in the CMS Showoff section, but it uses the Products module and AJAX: http://travel-wild.com/. I'm hoping there's a less complex solution!
Stikki

Re: ListIt2 smart filtering

Post by Stikki »

This is pretty custom request.

There is nothing ready for this, as it's frontend development.

Basically you would need to make SQL request always when something changes in your dropdowns and probably push results into JSON string and then update dropdowns based on that data.

Can be done but you need to know MySQL and PHP to achive this.
User avatar
tophers
Forum Members
Forum Members
Posts: 218
Joined: Thu Jun 07, 2007 7:25 pm
Location: Calgary, Alberta, Canada

Re: ListIt2 smart filtering

Post by tophers »

Thanks Stikki - that's what I figured. Trying to put a budget together for this project and thought I'd see if anyone out there had done something similar before I get an estimate from my programmer.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: ListIt2 smart filtering

Post by velden »

Stikki's answer is (of course) the best option.

With another module (Gallery) I use some jQuery to filter the options in the select boxes. When second select box is changed I get the images via Ajax load.

Options of select box 1 and 2 are automatically generated from Gallery hierarchy (which must have 2 levels).

Proof of concept (temporary): https://tinyurl.com/ouzsaqk

Maybe you can use that same kind of logic in your case.
Wishbone
Power Poster
Power Poster
Posts: 1368
Joined: Tue Dec 23, 2008 8:39 pm

Re: ListIt2 smart filtering

Post by Wishbone »

Here's what I did on http://travel-wild.com

I used Products for this, but any list module will do. I created a category list template that counts items in categories and creates HTML dropdowns for them and place this on a page called 'search-ajax'. I use CGSimpleSmarty to place this content on the home page. I use jQuery to call a subroutine upon pulldown change, and call the search-ajax page with showtemplate=false using jQuery's 'load' plus other parameters that show which categories I've selected. The entire section with the pulldowns and trip count is replaced with the new set of pulldowns.

You can view source on the home page, and all the jQuery is there.

Example:

http://travel-wild.com/?page=search-aja ... ct2=Safari

The only issue is that this can be a bit slow, depending on server load, and you get all the baggage of CMSMS (much less with ?showtemplate=false) for the (should be) quick query, but more than you need. A more efficient way would be to call a custom PHP script to read the Products table directly and report the results.

It wasn't that hard, but requires a good understanding of how to use module templates to customize the module for uses it wasn't designed for, plus a fair amount of jQuery. This was my very first AJAX application.
zaidcrowe
Forum Members
Forum Members
Posts: 109
Joined: Wed Jun 10, 2009 3:43 pm

Re: ListIt2 smart filtering

Post by zaidcrowe »

going on what Wishbone has said, there was a {cache} udt or module, that you could wrap around the page that produces the ajax responses

it had a key parameter, that you could set dynamically based on what the front end UX is searching for, meaning all the permutations of searches would be cached and delivered as flat html...might help but will required some digging in the forge :)
Post Reply

Return to “Modules/Add-Ons”