Linking to the INN-Reach Central Catalog

If your library participates in an INN-Reach consortium, you can provide two types of links on PowerPAC pages to the INN-Reach central catalog:

Simple link to the INN-Reach central catalog web site - You can provide a simple link to the INN-Reach central catalog web site. For example, you may want to provide the link on the library’s PowerPAC portal page, in a PowerPAC dashboard, and/or on the “No Hits” search results page. The patron clicks the link and enters or re-enters the search term on the INN-Reach central catalog web site. See Customizing Pages.

Deep link to INN-Reach central catalog search - You can provide a custom link that allows the patron to search the INN-Reach central catalog without re-entering the search term. For example, if a patron searches for global warming in PowerPAC and doesn’t find anything suitable, the patron can click a link to search the INN-Reach catalog and go directly to the INN-Reach central catalog search results page for global warming. With this method, a JavaScript .js file extracts the search term from the URL of the patron’s brief results page and passes it in the referring URL to the INN-Reach catalog.

Note:
The deep link method described here works only on the PowerPAC brief search results page because the PAC URL for this page contains the search term (term=). If the patron has navigated to the full display for a title in the search results, the URL no longer contains the search term; therefore, the INN-Reach link goes to the INN-Reach catalog’s home page.

For details about this method, see:

As with other Polaris PAC customizations, you need some knowledge of HTML and other techniques to do this procedure. You must implement the script as explained here. Polaris Support can provide basic troubleshooting if you run into problems, but cannot implement it for you. If your customizations break the code, Polaris Support can help you revert back to the original.

Create deep links to the INN-Reach central catalog

Use the C:\Program Files\Polaris\[version]\PowerPAC\custom folder for your customizations to prevent them from being overwritten at upgrade. If you have a custom theme, you can create and name a subfolder for your custom theme, and then create appropriate subfolders within that folder. For details, see PowerPAC Directory Structure.

Step 1: Add a JavaScript file to your PowerPAC server

  1. Create a text file and name it inn-reach-pac-link.js. The script format differs depending on the INN-Reach central catalog discovery platform:
  1. Change the second line of the script so that it represents the URL of your INN-Reach central catalog.
  2. Place the script file in your PowerPAC custom folder or subfolder.

Step 2: Modify your custom PowerPAC theme

Working in your custom site-{theme}.scss file, add the following so that your INN-Reach links look and behave like traditional hyperlinks.

.irLink {

cursor:pointer;

cursor:hand;

text-decoration: none;

color: navy;

}

.irLink:hover {

text-decoration: underline;

color: red;

}

Note:
You must assign a unique class (irLink) and in your CSS provide some rules that make your links look and behave like hyperlinks. The example above assumes your hyperlinks work like the PowerPAC default links. If you customize the default styles for how links look and work, be sure the rules for the irLink class mimic your styles for conventionally linked items.

Step 3: Create (if necessary) and modify your custom PowerPAC site.master

  1. Create a custom site.master file in your custom theme folder. See Customizing Layouts.
  2. Open the custom site.master file and locate the </body> tag near the bottom.
  3. Open a line before the closing body tag and provide the link to your JavaScript file in this format:

<script type="text/javascript" src="{FILE PATH}"></script>

where FILE PATH is the path and filename of your JavaScript file; for example:

//testdriveprod.polarislibrary.com/polaris/custom/testdrive/scripts/inn-reach-pac-link.js

The path for your site depends on how you have structured the custom subfolders and your servername, if you do not use a relative path.

Step 4: Create the links to the INN-Reach central catalog

The links will look and work like normal web hyperlinks, but the HTML is different. The JavaScript method of linking to the INN-Reach central catalog invokes the script every time the user clicks on the link. The script looks for search terms in the PowerPAC URL and if they exist, passes them on to the INN-Reach catalog. (The link is interactive and dynamic rather than static.)

For example, a conventional HTML link that says Click here to search Prospector looks like this:

<a href=”http://iii.com” target=”_blank”>Click here to search Prospector</a>

The link using the JavaScript looks like this:

<span class=”irLink” onclick=”gotoIRCat();”>Click here to search Prospector</span>

Step 5: Place your link on PowerPAC pages

You can place the link anywhere in PowerPAC that allows you to place HTML. For example:

Important:
If the PowerPAC URL contains a search term from the patron's search results page, the link will launch a search in the INN-Reach central catalog. If no search term is present in the URL, the link takes the patron to the INN-Reach central catalog home page.

Sample JavaScript for INN-Reach Central Catalog, Encore Discovery Platform

If you are linking to an INN-Reach central catalog with an Encore discovery platform, the following is an example of the entire contents of your inn-reach-pac-link.js file (not including the table):

function gotoIRCat() {

var irURL = '//encorecalstate.iii.com/iii/encore';

function getParameterByName(name) {

name = name.replace(/[\[\]]/g, "\\$&");

var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), results = regex.exec(window.location.href);

if (!results) return '';

if (!results[2]) return '';

return decodeURIComponent(results[2].replace(/\+/g, " "));

}

var searchTerm=getParameterByName("term");

if ((getParameterByName("by") != "CN") && (searchTerm != '')) {

irURL += '/search/C__S' + getParameterByName("term") + '__Orightresult';

}

window.open(irURL);

}

Sample JavaScript for INN-Reach Central Catalog, WebPAC Discovery Platform

If you are linking to an INN-Reach central catalog with a WebPAC discovery platform, the following is an example of the entire contents of your inn-reach-pac-link.js file (not including the table):

function gotoIRCat() {

var irURL = '//albert.rit.edu';

function getParameterByName(name) {

name = name.replace(/[\[\]]/g, "\\$&");

var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), results = regex.exec(window.location.href);

if (!results) return '';

if (!results[2]) return '';

return decodeURIComponent(results[2].replace(/\+/g, " "));

}

var searchTerm=getParameterByName("term");

if ((getParameterByName("by") != "CN") && (searchTerm != '')) {

irURL += '/search/X?SEARCH=' + getParameterByName("term") ;

}

window.open(irURL);

}