Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 13 Next »

There are currently four optional modules in the CSU Central Package that can be enabled in your local package custom.js file.

  • sendSMS – adds a send-to option to text the title's call number to a phone number.
  • reportProblem – adds a prominent 'report a problem' link to the service container on the full record page.
  • multipleAnalytics – adds Google or Matomo Analytics to Primo
  • customUresolver – replaces Get It Menu with one of our own design


To enable an optional module, you must do two things:

1. Load the module

Currently, you custom.js has this line near the top of the file: 

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

The section in brackets is an array.  To add the sendSMS feature, for example, you need to add it to the array, like this:

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

Multiple features can be added in this way, just separate each one by a comma:

var app = angular.module('viewCustom', ['sendSms','reportProblem','multipleAnalytics', 'customUresolver', 'angularLoad']);

This loads the modules into your custom.js file.  Next, you'll configure them.

2. Configure the module

Each module has configurations that also need to be set, including the property to enable the feature in the interface.  Add the corresponding code for each module directly below the code in step 1.

sendSMS

This module only requires one property be set, to enable the module.

app.constant('smsOptions', {
  enabled: true
});

You can optionally include the following properties to change the label and the position of the feature within the list.

app.constant('smsOptions', {
  enabled: true,
label: 'Text', // the label that appears under the icon
index: 9 // position within the send-to list, first position = 0
});

Finally, you can change the list of carriers, by setting a separate smsCarriers configuration.

app.constant('smsCarriers', {
'ATT': 'txt.att.net',
'Cricket': 'mms.mycricket.com',
'Nextel': 'messaging.nextel.com',
'Project Fi': 'msg.fi.google.com',
'Qwest': 'qwestmp.com',
'Sprint': 'messaging.sprintpcs.com',
'T-Mobile': 'tmomail.net',
'Verizon': 'vtext.com',
'Virgin': 'vmobl.com'
});

reportProblem

This module requires you to se the email address that will receive the problem report.  Also enable the module.

app.constant('reportProblem', {
to: 'dwalker@calstate.edu',
enabled: true
});

You can optionally set the following properties.  Example below includes defaults.

app.constant('reportProblem', {
to: 'dwalker@calstate.edu',
enabled: true,
messageText: 'See something that doesn\'t look right?', // text that appears before the link
buttonText: 'Report a Problem', // the portion of the text that is the link
labelEmail: 'Email', // change the form email field label
labelName: 'Name', // change the form name field label
labelDescription: 'Description', // change the form description field label
subject: 'Problem report', // email subject line
format: 'markdown', // specify email format
});

multipleAnalytics

Set the siteSource to either ga for Google Analytics or matomo for Matomo Analytics.

siteID should be your Google Analytics tracking code or similar code for Matomo.

siteURL should be the Google Analytics link or similar link for Matomo.

defaultTitle should be OneSearch or similar name for tracking purposes.

app.constant('analyticsOptions', {
enabled: true,
siteSource: 'ga',
siteId: 'UA-12345678-1',
siteUrl: 'https://www.google-analytics.com/analytics.js',
defaultTitle: 'OneSearch'
});

customUresolver

Set showCompact to true if you want the item display to always be 'collapsed' when there is more than one item.

Set showRequestInViewIt to true if you want to show request options when there is no physical holdings (when there is a view it menu only, should result in an illiad link).

Set requestShowOptions to true if you want to display options for requests placed - these are dynamically pulled from the original Alma request form and should be configured there.

illURL should be your ILLiad URL.

locateURL is the url used for the item/holding locate button. The replaceable variables must include the curly brackets. These variables are the same ones used by Primo in the default maps/locate settings:

  • {library_code}
  • {location_code}
  • {location_name}
  • {call_number}
  • {title}


app.constant('customUresolver', {
enabled: true, //required -- default is false
showCompact: false, //optional -- default is false
showRequestInViewIt: false, //optional -- default is false
requestShowOptions: false, //optional -- default is false
illURL: 'https://illiad.example.edu/illiad/illiad.dll', //required -- default is ''
locateURL: 'http://www.library.edu/primo-location-maps/{library_code}/{location_code}/{call_number}' //optional -- default is ''
});

hideRapido

To hide the Rapido tile when full-text is available add this to your local package:

app.value('hideRapido',{
enabled: true
}); 


  • No labels