Embedded Search Box for Primo VE

OVERVIEW

Many institutions choose to embed GIL-Find (Primo) search boxes on their library website, libguides, etc. This allows for searches to be initiated directly from a website. Doing this requires some knowledge of HTML, but it is more or less a matter of inserting an snippet of HTML into your library site.

RESOURCES

Ex Libris Documentation

Instructions for creating an embedded search box from ExLibris

GIL FIND PRIMO SEARCH WIDGET/LINK CREATOR (This is currently being updated and will not work with VE)

This web-app is the most robust and simple way to create an embedded search box for any institution.

Simply selecting your institution and clicking generate will output the HTML code needed for a simple search field, (although other facets and options are available).

This is the link to the website:

https://alma-configs.galib.uga.edu/gilfindembedwidget/usg_primo_search_creator.html

Below is another way to generate this field and allows some other options.

INSTRUCTIONS FOR SIMPLE Primo VE SEARCH BOX

The following code will need to be pasted into any HTML file to embed a simple search box, with some changes listed below:

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<!-- Script that converts the query string into valid parameter -->

<script type="text/javascript">

function searchPrimo() {

document.getElementById("primoQuery").value = "any,contains," + document.getElementById("primoQueryTemp").value;

document.forms["searchForm"].submit();

}

</script>

</head>

<body>

<!-- Fill in Highlighted Parameters -->

<form id="simple" name="searchForm" method="get" target="_self" action="https://<host_name>/discovery/search" enctype="application/x-www-form-urlencoded; charset=utf-8" onsubmit="searchPrimo()">

<input type="hidden" name="vid" value="<inst_code>:<view_code>">

<input type="hidden" name="tab" value="<tab_code>">

<input type="hidden" name="search_scope" value="<scope_name>">

<input type="hidden" name="lang" value="<2_char_lang_code>">

<!-- Fixed parameters -->

<input type="hidden" name="query" id="primoQuery">

<input type="text" id="primoQueryTemp" value="" size="35">

<!-- Search Button -->

<input id="go" title="Search" onclick="searchPrimo()" type="button" value="Search" alt="Search" style="height: 22px; font-size: 12px; font-weight: bold; background: #DE6E17; color: #ffffff; border: 1px solid;">

</form>

</body>

</html>

Open the code above in Notepad and make the following changes:

  • <hostname> should be replaced with your base Primo URL. For example, UNG's is "galileo-ung.primo.exlibrisgroup.com".

  • The vid value, <inst_code>:<view_code>, should be replaced with your institution and view code. This can be found in your Primo VE URL (it will say vid=something). For example, UNG's is 01GALI_UNG:UNG_V1

  • The <tab_code> equals LibraryCatalog (if you want a institution specific search, not USG)

  • The <scope_name> equals MyInstitution

  • the <2_char_lang_code> will equal en

Save the code/doc as an .html file then open that html file and test a search.

Below is the HTML code for UNG, so you can see what changes have been made:

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<!-- Script that converts the query string into valid parameter -->

<script type="text/javascript">

function searchPrimo() {

document.getElementById("primoQuery").value = "any,contains," + document.getElementById("primoQueryTemp").value;

document.forms["searchForm"].submit();

}

</script>

</head>

<body>

<!-- Fill in Highlighted Parameters -->

<form id="simple" name="searchForm" method="get" target="_self" action=https://galileo-ung.primo.exlibrisgroup.com/discovery/search enctype="application/x-www-form-urlencoded; charset=utf-8" onsubmit="searchPrimo()">

<input type="hidden" name="vid" value="01GALI_UNG:UNG_V1">

<input type="hidden" name="tab" value="LibraryCatalog">

<input type="hidden" name="search_scope" value="MyInstitution">

<input type="hidden" name="lang" value="en">

<!-- Fixed parameters -->

<input type="hidden" name="query" id="primoQuery">

<input type="text" id="primoQueryTemp" value="" size="35">

<!-- Search Button -->

<input id="go" title="Search" onclick="searchPrimo()" type="button" value="Search" alt="Search" style="height: 22px; font-size: 12px; font-weight: bold; background: #DE6E17; color: #ffffff; border: 1px solid;">

</form>

</body>

</html>