Closed (fixed)
Project:
Better Exposed Filters
Version:
6.x-1.0
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Issue tags:
Reporter:
Created:
31 Mar 2011 at 09:28 UTC
Updated:
12 Feb 2014 at 08:46 UTC
Jump to comment: Most recent
Comments
Comment #1
Frederic wbase commentedI've solved this myself with a theming function in the template file wich creates a new form from the items in the exposed filter. Then when a link is clicked i submit it to the exposed form with jquery. The exposed form i have simply hidden with css(display:none).
Moreover, I have seen this feature is partially in the new dev version. But I didn't succeed to get it working.
Here's my solution:
theming function
jquery
Comment #2
kccmcck commentedHi Frederic, any idea how to get this working with BEF 7.x-1.x-dev and Views 7.x-3.0-beta?
Comment #3
Frederic wbase commentedHello Kathryn531
I have seen in the code that in the beta version the option for printing exposed filters as links is included. But i have no idea or its already working.
grts
Frederic
Comment #4
mikeker commentedThere is an option in the D7 branch, which was recently checked into the D6 branch, that allows you to set exposed sort options as links.
There's no reason that couldn't be extended to work with any other filter as well.
Comment #5
mikeker commentedThis has been checked in for the D7 branch. To get the
bef-select-as-links-selectedclass to show on selected links you'll need to patch core until #1114398: Form element & Form element label theming is broken is fixed.Note: this functionality might change as a result of #1137720: POST for exposed filters. Currently I'm using GETs (changing the URL), but that doesn't play nicely with AJAX views.
Backporting to D6 is going to be lower priority for now as my main focus is on getting an initial D7 release and an updated D6 release out.
Comment #6
funkytraffic commentedSorry I donnot really get the point. Could you give a more precise description?
Comment #7
mikeker commentedThe features is only in D7 right now. It's not using javascript/display:none, it's rewriting the select element at the theme layer as links. Because it's using GETs, it doesn't work well with AJAX in Views.
The D7 roadmap is to get as much existing functionality working and put out a 1.0 release. D6 work right now is mostly bug fixes in hopes of getting a 1.1 release out the door.
Doing exposed filters as tabs is outside the scope of this issue. Please open a feature request for that. I haven't looked into fiddling with the entire exposed form before so I don't know if it's feasible, but it would be cool!
Thanks.
Comment #8
funkytraffic commentedThanks for information. But is there a big difference beetween tabs and links? If I use the exposed filter variable theming views I could style it like tabs with css.
The alternative is using Views Display Tabs, but i donnot really like this approach. Using BEF saves a lot of efforts.
If I understand you right, the Views Ajax function does not like a theming overwrite, because it expects the standard exposed filter input form.
edit: in fact I get a error 500 message on drupal 7
Comment #10
mikeker commented@funkytraffic: I'm not familiar with Views Display Tabs, so I can't comment on it.
But Views' AJAX functionality is not really affected one way or the other by theming changes. The reason the BEF links option doesn't play well with it is because BEF links is using URLs to send filter selections to Views while Views AJAX is using Javascript.
In short, you can theme the look-and-feel of an exposed filter all you want without affecting AJAX functionality.
Comment #11
chefarov commentedHello all.
I try Federic's approach on #1 (on drupal 6) and I get the terms listed(li) but not as links, just text...
Moreover I would like to remove the classic select list form generated by the view and keep only the listed terms.
Can anyone help? thanks.
Comment #12
Frederic wbase commentedThats why you need the js also. When you click an item, the js will submit the original exposed filter and the form will reload.
Just hide the original exposed filter (css display:none). And put css cursor: pointer on the list items.
grts
fre
Comment #13
chefarov commentedHello Frederic, thanks for the reply.
You are right about the ccs(display:none) I didnt notice it in the 1st post.
For the links what I do is:
1. Put your theming function in template.tpl.php file changing:
2. Insert a script in mythemename.info file
What Am I missing?
Comment #14
Frederic wbase commentedIts hard for me to say it like that. Can you post your code like you have changed it? Can i have look at the website where you wan't to apply this code?
Then i can review it and give you better explenation...
ps: sorry for my bad english
Comment #15
AlexanderPop commentedhttp://drupal.org/project/views_hacks helped me
Comment #16
castawaybcn commentedI am trying to do the same as Frederick and chefarov but I am getting a WSOD with views 3. Is this only compatible with views 2?
@chefarov, did you succeed with your try?
Comment #17
Frederic wbase commented@castawaybcn i've only tested this with views 2.x
Normal this should be added by default in the latest version of better exposed filters & views 3.x
grts
frederic
Comment #18
edulterado commentedThe approach in #1 worked for me using Views 3, with two little modifications:
instead of using
function phptemplate_views_exposed_form(&$form)(which didn´t work for me) I put the code in a hook_form_alter() of my custom module:I wrapped the jquery code in a Drupal.behaviors function (otherwise, it didn´t work for me):
It looks like an useful, quick - and possibly dirty - hack for using a list of links in a exposed filter form while preserving the AJAX capability of the view. I tried another working approach here, without AJAX.
Comment #19
csuggs4 commentedI was looking for such a solution for Drupal 7. I had to modify how the JS was attached, and instead of triggering the form submit had to trigger the change event on the hidden select input. Here's what worked for me:
Comment #20
siva.thanush commentedBetter expose filter would do it.
and which doesn't support for liks but radio/check boxes.
To make the link work
Here is a simple patch
https://drupal.org/files/issues/select_as_links_backport_to_6.x-1.x-1159...