I've fallen in love with this module and the simplicity of it :-D

I ditched the project I mentioned for you in the mail a couple of days ago, and I got the functionality I needed (Multi-step filtering, i.e. select place, click apply, goes to the next page where nodes in that place are listed, and continue to drill down by some other filters) by combining Panels, views and adding the option of hidden exposed filters to the better exposed filters module. (I'm considering making a handbook How-To page of this, as I've spend hours on this problem)

I allso replaced your use of the htmlentities PHP function with Drupals very own check_plain, as the first one did not play well with my Norwegian ÆØÅ letters. (This has something to do with Drupal being a UTF-8 application)

Attached is a patch that adds the new functionality, and fixes the bug.

CommentFileSizeAuthor
#2 hidden2.patch6.06 KBmikeker
hidden_fields.patch14.16 KBVidarls
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mikeker’s picture

Assigned: Unassigned » mikeker

Thank you for the patch and for the addition to allow multi-step filtering. Yes, please write up a how-to when you have the time! I can also see adding AJAX/AHAH support for this so as to avoid the page refresh on each step.

I haven't had time to look at the patch yet and probably won't for a few days, but I'll get it into head as soon as I can.

- Mike

mikeker’s picture

FileSize
6.06 KB

Vidar,

Unfortunately, your patch shows up as a complete rewrite -- namely, every line is marked as a change which made it hard to figure out what you had changed. I've gone through the patch and tried to extract the relevant changes but I would appreciate your help making sure I got them all.

Also, thanks for the UTF-8 fixes. Always good to have someone using non-standard characters trying things out! htmlentities() has been replaced with check_plain().

I've attached a patch with my changes. If you could give them a try with your multi-step filters, I'd appreciate it. Or, if you could give me an example of how you're building these multi-step filters, I can include those in my (currently manual, soon to automated) testing.

Many thanks.

- Mike

Vidarls’s picture

I didn't notice that my patch did that. I suppose it is because I deleted line 1..
Looked through your patch, and It seems to be quite identical to the one I sendt in , (except this one actually tells what changes... :-P )

I've not had the time to actually test your patch (<shamefull>I have really not taken the time to actually learn how to apply a patch</shameful>)..
But here is a quick guide to multistep filtering:
The key factors are:
1. Exposed filters are transmitted using the Get method (by the url).
2. Exposed filters settings are received and transmitted even if the HTML field type is hidden
3. As long as the Exposed filter ident (set in the exposed filters setup) are identical, multiple displays of a view, and even several views can share the same exposed filters.
4. Views in panels can override the views URL

Step 1: Create your views and dislpays
- Set up one view with two page displays
- Create one set of exposed filters in the default display
- In page display #1 remove all exposed filters exept one (i.e. some sort of geographical selection)
- In page display #2 Keep all exposed filters, but use Better exposed filters to set the display of the filter used in display #1 to hidden

Step2: Create panel pages.
- Create one panel page for each display
- Add the displays from the view, one display for each panel page.
- Set the override view Url setting of the view in the first panel page to the url of the second panel page.
- Set the override view Url setting of the view in the second panel page to the url of the second panel page (self).

Workflow explained:
- Viewing the first panel page, containing the first Display of the view, the user only gets one filter, and the list containing all the items.
- After making a selection in the first panel page and clicking "apply", the panel pages "override view url" settings takes the user to the second panel page, but the $_GET variables are kept, and propagated aswell. And since we have an exposed filter with the same key as the previous display (But displayed as hidden fields) The filter is applied to this display page. And as an added benefit of keeping this exposed filter as a hidden field: When the user makes a selection in this second panel page the value of the hidden field is again propagated, keeping the originally selected value "in memory"
(You can check out my attempt here: http://www.dyreklinikk.no CAUTION: Norwegian language only, the letters Æ,Ø and Å may bite if not properly encoded)

This was a really quick walkthrough, I hope i make sense... If not, please ask.
I will attempt to make a handbook page of this when the patch makes it into an official release.

- Vidar

mikeker’s picture

Status: Needs review » Fixed

Checked in code to enable the hidden option. Thanks Vidar!

Note: UTF-8 issue was fixed in an earlier checkin.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.