Left Menu Right Menu
June 12, 2018

Show/Hide Other Institutions (July 2018 revision)

Show/Hide Other Institutions (July 2018 revision)

Created by: Paul Ojennus (Whitworth University)

Code repository:

Description: 

Add a button in the detail display that will toggle display of the list of institutions holding the item. You can customize the labels on the button and set the default state of the list as visible or hidden.

Note:

The Premium Sandbox Central Package has been updated to this revision as of 6/1/18, so you may test it there now. The Production Central Package will be updated on 7/1/18.

The update to this customization addresses several issues with the original customization: 1) the customization hangs on the prmAlmaMoreInstAfter hook in the local package, so that individual institutions can use that hook for other customizations also 2) the code follows the enclosure practices recommended by ExLibris so it will be easier to update and work better with the DevEnv and 3) it follows the PCSG guidelines for accessibility.

Hidden:

Shown:

System Components: PBO, Package Manager

Skillset Requirements: PBO, Javascript

Accessibility

Browser Support

Mobile Support

Implementation Steps:

  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 ‘toggleInstitutions’ in your app definition, for example:

    var app = angular.module('viewCustom', ['toggleInstitutions']);

    If you are using other angular modules your app definition will include those also. For example:

    var app = angular.module('viewCustom', ['angularLoad,''customActions', 'reportProblem','toggleInstitutions']);

  1. In your local package, in the custom.js file, add the following line of code:

    app.component('prmAlmaMoreInstAfter', { template: '<toggle-institutions />' });
  2. If you want to customize your button (labels, default state), add the following block of code and edit the values for your preferences:

    app.constant('showHideMoreInstOptions', {
            default_state: 
    "hidden",
            show_label: 
    "Show libraries",
            hide_label: 
    "Hide libraries"
    });

    For “default_state” you can set this to “hidden” or “visible”.

    “show_label” and “hide_label” can be any text string that you want to appear on the button.

    By default, the values are “hidden”, “Show Summit Libraries” and “Hide Summit Libraries”.
  3. The button has the ID “summitButton”, so you can style it in css with #summitButton
  4. If you implemented the earlier version of this customization, be sure to remove that code from your custom.js.
  5. Zip and upload your package
  6. Deploy your view


Related Customizations

Turn on inheritance from the Central Package

Make changes in your local package

Back to Blog
Comments (0)
Reply To Article