uidaholib/primo-explore-custom-actions

Name: primo-explore-custom-actions

Owner: UIdaho Library Digital

Description: adds custom actions to primo's actions menu.

Forked from: alliance-pcsg/primo-explore-custom-actions

Created: 2017-06-08 23:19:01.0

Updated: 2017-06-08 23:19:03.0

Pushed: 2017-06-02 22:57:01.0

Homepage: null

Size: 8

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

primo-explore-custom-actions

installation
setting up the dev environment

if you don't have a package.json as part of your view code, go to your package directory (e.g. /primo-explore/custom/LCC_NEWUI) and run:

init

follow the prompts and fill out basic information for your package.

installing the package

from inside your package directory (e.g. /primo-explore/custom/LCC_NEWUI), run:

install primo-explore-custom-actions

to add custom actions, edit your 2_options.js (or another file in the package's js directory) and add the following lines:

rtActions([{
name: "Report Problem",
type: "template",
icon: {
    set: 'action',
    name: 'ic_report_problem_24px'
},
action: "http://my.institution.edu/report_problem?record_id={recordId}"


name: "My Link",
icon: {
    set: 'action',
    name: 'ic_open_in_new_24px'
},
action: "http://google.com/"


name: "Open PNX",
type: 'template',        
icon: {
    set: 'action',
    name: 'ic_stars_24px'
},
action: "/primo_library/libweb/jqp/record/{pnx.control.recordid}.pnx"


name: "My other link",
type: 'template',        
templateVar: ['test', 'me'],
icon: {
    set: 'action',
    name: 'ic_stars_24px'
},
action: "http://www.example.com/{0}/{1}"


configuring custom actions

this code works by supplying a list of action objects you wish to be included. each action object can have up to four properties:

you can edit the code in your 2_options.js to change these values.

adding the above example code would add four actions (not recommended, as space is limited on the actions menu):

uninstalling the button

from inside your package directory (e.g. /primo-explore/custom/LCC_NEWUI), run:

uninstall primo-explore-custom-actions

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.