Download & Extend

Add CSS class to "Show more/less" links in facet blocks

Project:Apache Solr Search Integration
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

To allow for more granular theming of the JS-added links.

Comments

#1

Adding patch file.

AttachmentSizeStatusTest resultOperations
apachesolr_505652_1.patch533 bytesIgnored: Check issue status.NoneNone

#2

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

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.

AttachmentSizeStatusTest resultOperations
apachesolr_505652_3.patch527 bytesIgnored: Check issue status.NoneNone

#4

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

#5

Status:needs review» fixed

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

#6

Status:fixed» reviewed & tested by the community

Simple enough, tested, works.

Resulting link:

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

#7

Status:reviewed & tested by the community» fixed

#8

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

#9

Status:fixed» closed (fixed)

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