Central Package optional features

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.

  • hideRapdio – hide Rapido offers when full-text is available.



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', 'angularLoad']);

Note: Do not do this for the hideRapido feature.  That is not implemented as a module.

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 ga4 for Google Analytics or matomo for Matomo Analytics.

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

siteURL is only needed if you’re using Matomo, and is link to your Matomo tracking site.

defaultTitle should be OneSearch or similar name for tracking purposes.

app.constant('analyticsOptions', {
enabled: true,
siteSource: 'ga4',
siteId: 'G-12345678',
});



hideRapido

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

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