Add CSS class to "Show more/less" links in facet blocks
bdurbin - June 29, 2009 - 20:54
| Project: | Apache Solr Search Integration |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
To allow for more granular theming of the JS-added links.

#1
Adding patch file.
#2
That file just patches the .js file. I would have expected a change to the module that renders the block (to add the css class), and to the .css file as well. Can we think of a shorter class name?
#3
Thanks for taking a look. Those "Show more / Show less" links are actually appended to the blocks on the client side when the page loads. They don't exist on the server when the blocks are rendered.
Are you suggesting that we refactor the blocks display code so that the links are generated at that time, and add the class there? I'd be happy to help explore that if that's the route you'd like to take. Not knowing the reasoning behind the current implementation, I do wonder if the links are added via JS to avoid something that was difficult to solve on the server.
Updated patch with shorter CSS class name.
#4
I think you are right with this approach, since indeed this link will never exist without javascript being enabled.
#5
Agree, now that I look at it in closer detail. Committed.
#6
Simple enough, tested, works.
Resulting link:
<a class="apachesolr-showhide" href="#">Show more</a>#7
#8
Confirming #3 works. Much easier to theme and design now. Thanks
#9
Automatically closed -- issue fixed for 2 weeks with no activity.