Developer
Paul Ojennus, Whitworth University
Description
Adds a link in the Primo brief results tile when item is available from HathiTrust; the link resolves to the item in HathiTrust. Libraries may customize the behavior based on local holdings, material type and copyright status. Partner institutions may include automatic login information. This is an adaptation of the UMNLibraries version at https://github.com/UMNLibraries/primo-explore-hathitrust-availability
System Components
Alma Discovery Package Manager
Skillset Requirements
Alma Discovery, JS, CSS
Accessibility
Tested for keyboard navigation, NVDA reads aria labels correctly
Browser Support
Tested on Chrome, Edge, Firefox, and Safari
Mobile Support
Tested on Android and 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 ‘hathiTrustAvailability’ in your app definition. For example:
var app = angular.module('viewCustom', ['hathiTrustAvailability']);
If you are using other angular modules, include them in your app definition as well. For example:var app = angular.module('viewCustom', ['hathiTrustAvailability', 'oadoi']);
- 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):
app.component('prmSearchResultAvailabilityLineAfter', { template: '<hathi-trust-availability></hathi-trust-availability>' });
- Optional: include the following block of code to customize the options:
app.value('hathiTrustAvailabilityOptions', {
msg: 'Full Text Available at HathiTrust',
hideOnline: false,
hideIfJournal: false,
ignoreCopyright: false,
entityId: '',
excludeNotLocal: true
}); - Values may be customized as follows:
- msg: The text value you want for the link. Default value is ‘Full Text Available at HathiTrust’
- hideOnline: set to true to hide the link if services are available; set to false to always show the link. Default value is false.
- hideIfJournal: set to true to hide if the resource type is “journal”; set to false to always show the link. Default value is false.
- ignore Copyright: set to false to show only freely available items; set to true always show the link. Default value is false.
- entityId: If you are a member institution, you may enter your Entity ID here to enable automatic authentication. Default value is ‘’ (null).
- excludeNotLocal: set to true to show only items associated with your institution; set to false to always show the link. Default value is true.
- Optional: add custom styling to the link. Copy the following code into your custom1.css and adjust the styles to match your branding:
span.umnHathiTrustLink {
margin-left: -5px;
}
span.umnHathiTrustLink md-icon svg {
height: 1.2em;
filter: grayscale(100%);
}
span.umnHathiTrustLink:hover md-icon svg {
filter: grayscale(0%);
} - Zip and upload your package in Alma Discovery. Save your view.