HathiTrust Availability


Paul Ojennus, Whitworth University


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

Primo brief record with Full text available at Hathitrust added.

System Components

PBO and Package Manager

Skillset Requirements

Primo Back Office (PBO) and JavaScript


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



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)


  1. In the PBO, make sure you have the “Inherit Central Package” box checked.
  2. 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', ['toggleInstitutions', 'hathiTrustAvailability']);
  3. 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>' });
  4. 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: ''

  5. Values may be customized as follows:
    1. msg: The text value you want for the link. Default value is ‘Full Text Available at HathiTrust’.
    2. hideOnline: set to true to hide the link if services are available, set to false to always show the link. Default value is false.
    3. hideIfJournal: set to true to hide if the resource type is “journal”, set to false to always show the link. Default value is false.
    4. ignoreCopyright: set to false to show only freely available items, set to true to show all items. Default value is false.
    5. entityId: If you are a member institution, you may enter your Entity ID here to enable automatic authentication. Default value is ‘‘ (null).
  6. 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%);
  7. Zip and upload your package in the PBO.
  8. Deploy your view.