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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

cpliakas’s picture

Title: Use correct theme function in current search active item » Use a separate theme function for the active items in the current search blocks
Component: Code » Current Search Blocks
Category: bug » feature

Hi 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 their theme_facetapi_link_active function() to override everything but selectively override theme_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

Sunil S.’s picture

Issue summary: View changes

Hi 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.

ShaneOnABike’s picture

Thanks 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?

ndf’s picture

If we make theme_current_search_link_active rendering the same as facetapi_link_active by default, the regression issue should be fixed.
The improved version (like the added "X") then should be a configuration option.

ndf’s picture

Status: Active » Needs review
FileSize
4.57 KB

This 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.

  • eugene.ilyin committed 9c325a2 on 7.x-1.x authored by ndf
    Issue #1942922 by ndf: Use a separate theme function for the active...
eugene.ilyin’s picture

Thank you. Committed.

eugene.ilyin’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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