Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Continuing my support issue from here: #891974: Change display of exposed filters to links - pager, sort
In my opinion the best placement for this feature will be in this module.
This patch add new select option 'Links' in 'Display exposed sort options as:' dropdown.
This is the patch against the version with patch applied from: #657148: Add support for Exposed Sort #3
Comment | File | Size | Author |
---|---|---|---|
#23 | better_exposed_filters-894312-2.patch | 17.22 KB | kenorb |
#10 | better_exposed_filters-894312.patch | 20.96 KB | kenorb |
#9 | better_exposed_filters-894312.patch | 20.96 KB | kenorb |
#2 | better_exposed_filters.patch | 23.13 KB | kenorb |
better_exposed_filters.patch | 18.26 KB | kenorb |
Comments
Comment #1
kenorb CreditAttribution: kenorb commentedComment #2
kenorb CreditAttribution: kenorb commentedAdded 'Links' display as well for pager.
Please test it.
After testing it's good to move all theme files to separate better_exposed_filters.theme.inc file.
Comment #3
mikeker CreditAttribution: mikeker commentedkenorb, Thanks for the patch and your work on this issue!
Agreed, the theme function are getting large enough that they warrant their own theme.inc file. I'll refactor that the next time I do a major checkin.
I haven't had a chance to give you patch a try but hope to in the near future. In the meantime, any feedback from the community is appreciated!
Thanks.
Comment #4
dgastudio CreditAttribution: dgastudio commentedsubscribe
Comment #5
mahnster CreditAttribution: mahnster commentedI applied this patch, the second one in #2, but don't see a "link" option in the list of display options. Do I need to apply the patch in the original post as well? Or does the second patch have it with the 'added' feature?
Comment #6
mahnster CreditAttribution: mahnster commentedWell, I see that only one of the two patches can be applied, so I tried one, went back to original code, then the other, but even if I empty the cache and return to the Views edit screen and edit the filter to show this for, still nothing in the drop-down for "Links", just Radio/Checkboxes. Am I missing something?
Comment #7
kenorb CreditAttribution: kenorb commentedMake sure that you have: Exposed form style: Better Exposed Filters
Your pager or sort filter is exposed.
And in 'Exposed form style' settings select from 'DISPLAY EXPOSED SORT OPTIONS AS:' and 'DISPLAY EXPOSED PAGER OPTIONS AS:' dropdowns: 'Links' option.
If you don't see it, clear the cache or make sure that patch has been applied correctly.
Comment #8
chuckbar77 CreditAttribution: chuckbar77 commented+1 subscribing
Comment #9
kenorb CreditAttribution: kenorb commentedUpdated.
FIX: Link shouldn't be generated when sorting or pager is the same as current.
Comment #10
kenorb CreditAttribution: kenorb commentedSmall fix with url link encoding, when changing from one sorting to another one.
Known issues:
Doesn't work when AJAX Pager is enabled. Link path have to be updated.
Comment #11
dgastudio CreditAttribution: dgastudio commentedit work with views 2.6?
Comment #12
kenorb CreditAttribution: kenorb commentedTested with Views 3.x.
If Better Exposed Filters module works with 2.x, this patch should work as well.
Comment #13
dgastudio CreditAttribution: dgastudio commentedkenorb, i have applied your patch without any problem to last dev version of BEF.
but in views 2.6 (last stable) links doesnt appear.
P.D. Sorry for my english.
Comment #14
kenorb CreditAttribution: kenorb commentedUnfortunatelly Views 2.x doesn't support exposed 'Items per page'.
See: #324092: Expose: Items per page and Offset #60
Comment #15
dgastudio CreditAttribution: dgastudio commentedok, thank u!
Comment #16
YK85 CreditAttribution: YK85 commentedThanks for this awesome work!
Comment #17
YK85 CreditAttribution: YK85 commentedHi kenorb,
I was wondering if there has been any further development here or if patch at #10 (Oct 7th) is the final version?
Thanks!
Comment #18
AaronBauman+1
subscribe
Comment #19
ppcc CreditAttribution: ppcc commentedThe patch at #10 totally fails on the latest dev.
Comment #20
ppcc CreditAttribution: ppcc commentedWhat;s the best way to achieve this in views 3?
Comment #21
kenorb CreditAttribution: kenorb commentedComment #22
kenorb CreditAttribution: kenorb commentedI see that it's already partly implemented, theme callbacks:
http://drupal.org/cvs?commit=459396
http://drupalcode.org/viewvc/drupal/contributions/modules/better_exposed...
Source is changed a lot, so it's difficult to convert this patch.
Comment #23
kenorb CreditAttribution: kenorb commentedIn attachment latest patch against:
I don't remember if I did some new changes from patch #10.
Comment #24
mikeker CreditAttribution: mikeker commentedkenorb, Thanks for your continued work on this. I promise to get this reviewed and committed before more checkins break the patch again. I've only been able to work on this project in fits and starts recently...
Comment #25
kenorb CreditAttribution: kenorb commentedThere is as well special property in view handler, when it's TRUE, sort could be clickable.
i.e.
Comment #26
mikeker CreditAttribution: mikeker commentedI've checked in some preliminary code for supporting links as an option for BEF for Views 3.x. There is nothing preventing this from working for Views 2.x, it's just I haven't had the time to work with that yet.
Some (perhaps fairly large) caveats:
kenorb, thank you for your work (and patience) on this issue. Please give the current -dev release a try (in a test environment -- these changes are NOT ready for the real world yet) and let me know if things still work for your use case. Especially in light of the query string rewriting stuff... Thanks.
I really want to get this working with AJAX-based views so that a user could click on links at get "instant filter" style results. Basically another way to eliminate the Apply button. Anyhow that's my next push but with the holidays coming up time is scarce.
Comment #27
kenorb CreditAttribution: kenorb commentedWorks fine.
Comment #28
YK85 CreditAttribution: YK85 commentedRTBC
Comment #29
soraver CreditAttribution: soraver commentedhi,
i tried the last patch with the bef you mensioned and it didnt work for me.
it didnt show me "Links" on the drop down menu where it mensions ratio buttons etc.
i tried it with this:
version = "6.x-3.0-alpha3"
core = "6.x"
project = "views"
datestamp = "1270684211"
i followed the instructions on #7
but i dont see 'DISPLAY EXPOSED SORT OPTIONS AS:' and 'DISPLAY EXPOSED PAGER OPTIONS AS:'
i see 'Display "Taxonomy: Term" exposed filter as:' on the Exposed form/Exposed form style/options
and the drop down only has "Default select list", "hidden" and "checkboxes/ratio buttons"
i have cleared cache many times and i am sure that the patch has been applied correctly.
do you have any ideas? any place i should look at?
Comment #30
mikeker CreditAttribution: mikeker commentedAs per #26, this has been committed. Grab the latest -dev release instead of using kenorb's patch. There were several important changes between the patch and what was checked in. Also, make sure you've got at least one exposed sort in order to see those options. I just verified this is working with BEF 6.x-1.x-dev and Views 6.x-3.0-alpha3.
(Note: you will need to clear your caches after updating the code as this adds a couple new theme functions).
I'm marking has fixed (which I should've done at #26...) and closing. If you still have problems after using the -dev release, feel free to reopen and attach or paste an export of the view in question.
Comment #31
kenorb CreditAttribution: kenorb commentedComment #32
kenorb CreditAttribution: kenorb commentedComment #33
LetUsBePrecise CreditAttribution: LetUsBePrecise commentedThis works great. Just wondering if we can have link feature available for filter as well, like we have for sort at the moment.
Comment #34
mikeker CreditAttribution: mikeker commentedLinks are an option for filters in the 7.x branch. Not sure if that'll make it into the 6.x branch or not. Right now I'm trying to get a 6.x release out the door, which means new functionality takes a back seat to bug fixes.
Comment #35
LetUsBePrecise CreditAttribution: LetUsBePrecise commentedMay be once 6.x release is out and bugs are fixed, this link functionality for filter gets implemented in 6.x. Not sure if members like me are ready for 7.x branch for even next 2-3 years. This is really good module to use. Thanks for your contribution to drupal community.
Comment #36
mikeker CreditAttribution: mikeker commentedI've opened a new issue for the filters-as-links functionality: #1159232: Backport filters-as-links functionality from 7.x.
Thanks.
Comment #37
pitxels CreditAttribution: pitxels commentedI was wondering, if this solution was made with jquery and if a jquery.get() could be used so the links can work with the ajax option...
Comment #38
AlexanderPop CreditAttribution: AlexanderPop commentedhttp://drupal.org/project/views_hacks
Comment #39
dgastudio CreditAttribution: dgastudio commentedAlexander, a u sure that with views hacks we can show exposed filters as links?
check : #1118164: Can an exposed filter be rendered as a list of links?
Comment #40
threadsniper CreditAttribution: threadsniper commentedTrying to achieve the same thing on D7. Filter displays as links, but sort does not...