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.
I think the theme function called from the active item widget in item_active.inc is calling the wrong theme function on line 58. Now the theme_facetapi_link_active is called, but I think the correct function should be theme_current_search_link_active? This makes more sense and allows different theming in the filter blocks and current search.
Comment | File | Size | Author |
---|---|---|---|
#5 | facetapi--current_search_theme_function--1942922-05.patch | 4.57 KB | ndf |
|
Comments
Comment #1
cpliakas CreditAttribution: cpliakas commentedHi ramsalt.
Thanks for the post. This is actually by design so that the links could be themed the same was as their counterparts in the facets. I would be in favor of adding a new theme function, but at this point it would have to be done in a way that didn't effect existing installations. Maybe we could add the function that simply wraps the
theme_facetapi_link_active function()
? That way things would function as they still do and people could use theirtheme_facetapi_link_active function()
to override everything but selectively overridetheme_current_search_link_active()
to render the current search links differently.Another idea is that the current search links should use the same widget system as facets do. Currently thre architecture is a bit wonky in that it uses the theme functions that are called by the links widget, but doesn't allow you to configure the behavior of the display.
Based on the information given I am changing this to a support request, becausew the code works as intended, although it could be more flexible.
Thanks, and let me know what you think.
Chris
Comment #2
Sunil S. CreditAttribution: Sunil S. commentedHi Chris,
I am working on facet api, and have facets blocks. In facet blocks, the items are "link with checkbox" where checkbox are at left side by default.
Now, I have a block for current search and it has (-) by default at left side of the item text.
I want to change (-) to (X) and also want to move it to right of item text.
So I override the theme function theme_facetapi_link_active function() and the current search items are now displaying as I need like - Item One [X].
But this is also affecting the current active items in facet blocks, and the checkbox are coming at right of the active items, and for remaining inactive items, it is on left. I want all the checkbox at left items, but as both facet blocks, and current search block are using theme_facetapi_link_active function() function, so overriding is affecting both place.
Any solution how can I achive this? so that I can theme both blocks differently. You mention in above post to use some function to wrap.... but I am not getting the idea how to do that.
Any solution will be helpful.
Comment #3
ShaneOnABike CreditAttribution: ShaneOnABike commentedThanks for this super awesome module!!
I see that you implemented that in 7.2-dev and for whatever reason we can't use htat version in our deployment. Anyway that we could add this little tweak to the existing 7.1-dev version?
Comment #4
ndf CreditAttribution: ndf at Dx Experts commentedIf we make
theme_current_search_link_active
rendering the same asfacetapi_link_active
by default, the regression issue should be fixed.The improved version (like the added "X") then should be a configuration option.
Comment #5
ndf CreditAttribution: ndf at Dx Experts for Triquanta commentedThis patch overwrites all the current_search theme functions with those from facet_api.
- theme_current_search_link_active
- theme_current_search_deactivate_widget
- theme_current_search_accessible_markup
Therefor this should prevent any regression.
Next step is to improve on it so that current_search links looks different/better then they do now.
Comment #7
eugene.ilyin CreditAttribution: eugene.ilyin as a volunteer and at DrupalJedi commentedThank you. Committed.
Comment #8
eugene.ilyin CreditAttribution: eugene.ilyin as a volunteer and at DrupalJedi commented