Related product I-Share

Add a Custom Report a Problem button to the Send To Actions

Back to the Primo VE Customization Package: Shared CSS and JavaScript Solutions page

December 16, 2021

Objective: Add a Custom "Report a Problem" button to the "Send To" Actions in Primo VE that automatically captures the Title and Permalink of the full record page the user is on using the Springshare LibWizard service.  (It may be possible to use other services, but this example demonstrates the LibWizard Service only.) View this customization in the UIS Sandbox's Primo VE.

Image showing the Report a Problem button

How to accomplish this: The solution requires that you set up a Springshare LibWizard survey and that the following custom JavaScript code be added to the Primo VE /VIEW_CODE/js/custom.js file. See also this PowerPoint presentation from Evan Barber (UIS) at the Dec. 16, 2021 CARLI Alma/Primo VE Office Hours "Lab Reports".

1. Please review the steps for working with the customization package and its files on the main Shared CSS and JavaScript Solutions page

2. Navigate to the /VIEW_CODE/js/custom.js file and open it with a plain text editor.

3. Edit the preexisting text in the custom.js file:

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

to read:

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

(If you are using more than one Angular module in the custom.js file, you must include them all in the single "var app" definition in bracket section separated by commas.)

4. Insert the Custom Report a Problem button code block into the custom.js file.

5. Adjust the "link" URL and "label" text in the TEMPLATE portion of the code block to be your LibWizard URL and preferred text.

6. Save the changes to the custom.js file.  Here is an example of the custom.js file with the complete Custom Report a Problem code without any additional customizations in the file.

7. Zip the Customization Package back up and Upload it in Alma Configuration. For more details, see Working with the Customization Package.

Download the  JS

Download a text file with this custom JavaScript code for easy copying and pasting into your local custom.js file.

 

Special thanks to Evan Barber and Paxton Luangnikone at University of Illinois Springfield for contributing this solution; adapted for Primo VE from original code for Primo from Orbis Cascade Alliance.