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

bdurbin - June 29, 2009 - 20:56

Adding patch file.

AttachmentSize
apachesolr_505652_1.patch 533 bytes

#2

robertDouglass - June 30, 2009 - 11:38
Status:needs review» needs work

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

bdurbin - July 1, 2009 - 17:46
Status:needs work» needs review

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.

AttachmentSize
apachesolr_505652_3.patch 527 bytes

#4

pwolanin - July 1, 2009 - 21:55

I think you are right with this approach, since indeed this link will never exist without javascript being enabled.

#5

robertDouglass - July 1, 2009 - 22:05
Status:needs review» fixed

Agree, now that I look at it in closer detail. Committed.

#6

janusman - July 1, 2009 - 22:22
Status:fixed» reviewed & tested by the community

Simple enough, tested, works.

Resulting link:

<a class="apachesolr-showhide" href="#">Show more</a>

#7

pwolanin - July 1, 2009 - 22:42
Status:reviewed & tested by the community» fixed

#8

Onopoc - July 4, 2009 - 02:03

Confirming #3 works. Much easier to theme and design now. Thanks

#9

System Message - July 18, 2009 - 02:10
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.