Developer
Hui Zhang, Oregon State University
Description
The availability facets don’t show counts like other facet groups in Primo VE because they’re slightly inaccurate due to dedup/FRBR. However, libraries can use this customization to show approximate result counts to patrons before they click.
System Components
Alma Discovery Customization Package Manager
Skillset Requirements
Alma Discovery Package Manager, JavaScript
Accessibility
Not tested for accessibility
Browser Support
Tested on Chrome, Edge, Firefox, and Safari
Mobile Support
Tested on iPhone
Implementation
Overview
To enable this module, you will need to:
- Declare the module (Step 2)
- Insert a declaration to hold the code from the Central Package (Step 3)
Steps
- Turn on inheritance from the Central Package.
- In your local package, in the custom.js file, include the module
'availabilityCounts'
in your app definition. For example:var app = angular.module('viewCustom', ['hathiTrustAvailability', 'availabilityCounts']);
- Also in the custom.js file, add the following line of code within the anonymous function (that is, before the closing brackets at the end of the file)…
- If there is another module like
'external-search-contents'
already under'prmFacetExactAfter'
(replace'external-search-contents'
with the name of your module):app.component('prmFacetExactAfter', {
template: '<external-search-contents></external-search-contents><availability-counts></availability-counts>'
}); - Otherwise:
app.component('prmFacetExactAfter', {
template: '<availability-counts></availability-counts>'
});
- If there is another module like
- Optional: Include the following block of code to customize the message on availability count accuracy:
app.value('availabilityCountsOptions', {
msg: 'YOUR MESSAGE HERE'
});