Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rearranged facets #170

Merged
merged 3 commits into from
Feb 23, 2022
Merged

Rearranged facets #170

merged 3 commits into from
Feb 23, 2022

Conversation

hectorcorrea
Copy link
Member

Updated the order in which facets are displayed as requested in #161 and included the proper Blacklight configuration to allow the user to view "more" facet values when there are more than 10. I also fixed a problem with Author facet that was using a non-existing field.

facets

Notice that the Subcommunity facet displays only when (1) the user filters by community and the community has subcommunities (in practice this means it only shows when the community is PPPL)

facet_subcommunity

Closes #161

config.add_facet_field 'community_root_name_ssi', label: 'Community'
config.add_facet_field 'subcommunity_name_ssi', label: 'Subcommunity'
config.add_facet_field 'collection_name_ssi', label: 'Collection'
config.add_facet_field 'author_ssim', label: 'Author', limit: true
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

limit:true is what allows Blacklight to display the "more" value in the facet list that opens the pop-up window to view all facet values.

Comment on lines +82 to +85
// Hide the subcommunity facet unless we are faceting by community or subcommunity.
if (!activeFacet("community_root_name_ssi") && !activeFacet("subcommunity_name_ssi")) {
hideFacetGroup("subcommunity_name_ssi");
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the code that hides the subcommunity facet unless it's relevant.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love that you left a comment about where the inspiration for this came from. Very useful for long-term maintenance and kind to your colleagues!

Copy link
Contributor

@bess bess left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

Comment on lines +82 to +85
// Hide the subcommunity facet unless we are faceting by community or subcommunity.
if (!activeFacet("community_root_name_ssi") && !activeFacet("subcommunity_name_ssi")) {
hideFacetGroup("subcommunity_name_ssi");
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love that you left a comment about where the inspiration for this came from. Very useful for long-term maintenance and kind to your colleagues!

@bess bess merged commit 45ce2d5 into main Feb 23, 2022
@bess bess deleted the issue-161-facets branch February 23, 2022 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reorder and rename facets for search
2 participants