Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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.
  • hideRapdio – hide Rapido offers when full-text is available.


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

...

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.

...

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 ga4 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 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:

...

'

...

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}

...

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
});