Same Tab Menu Links

Created by

Jeremy McWilliams, Lewis & Clark College

Description

By default, menu links to non-Primo domains open in a new browser tab. This customization overrides that behavior and opens external links in the same browser tab.

Menu link in Primo

System Components

Alma Discovery (VE), Customization Package

Skill Set Requirements

JavaScript

Accessibility

Not tested

Browser Support

Chrome, Firefox, Safari

Mobile Support

Implementation

Overview

  • Enable Central Package in view
  • Edit custom.js file from local customization package
  • Zip package, and load to view via Alma Discovery

Steps

  1. Turn on inheritance from the Central Package.
  2. In local custom.js file, include sameTabMenuLinks in the app declaration near the top of the file:

    var app = angular.module('viewCustom', ['sameTabMenuLinks', 'anotherCust']);
  3. Inside the anonymous function in your local custom.js file, add the following code:

    /* begin same tab menu links */
    app.component('prmTopNavBarLinksAfter', {
    template: '<same-tab-menu-links></same-tab-menu-links>'
    });
    /* end same tab menu links */

  4. Save your custom.js file, zip your customization package, and upload it to your Primo VE view in Alma Discovery.