April 10, 2018

Back to Blog
Add Custom Action
Created by: Paul Ojennus, Whitworth University
Note: With special thanks to Nick Budak who originally developed the code.
Code repository:
Description: Add custom action such as report a problem, send text message, or view PNX to the “Send to” ribbon in Primo.

System Components: PBO, Package Manager
Skillset Requirements: PBO, Javascript
Implementation Steps:
- In the PBO make sure you have the “Inherit Central Package” box checked.
- In your local package, in the custom.js file, include the module ‘customActions’ in your app definition, for example:
var app = angular.module('viewCustom', ['customActions']);
(if you are using other angular modules your app definition will include those also.) - In your local package, in the custom.js file, include the following block of code from this file.
- You can customize the fields:
name: this is internal to the code, it just needs to be unique
label: this is the text that will appear in the Send To ribbon
index: any integer, 0 is on the far left
icon: the name of the icon from https://material.io/icons/
icon-set: the name of the icon set
link: the URL you are opening; you can insert data from the pnx as in {pnx.search.recordid[0]}
target: this set the action to open in a new tab/window is set to "_blank" or in the same window (useful for mailto: links) if set to "_self". If no value is set, this defaults to "_blank" - You can add multiple custom actions: repeat the <custom action> element in the template and assign a unique name to each action.
- Zip and upload your local package in the PBO
- Deploy your view
Related Customizations
Comments (0)