Skip to main content
  • Subscribe by RSS
  • Ex Libris Knowledge Center

    Embedding a Primo Search Box

    For customers using Primo VE, see Creating a Search Box with Deep Links to Primo VE.

    Primo allows you to add a Primo Search box to any local Web page by embedding Primo’s Brief Search deep link in an HTML form.
    Brief Search Box Embedded in an HTML File
    For more information on Brief Search deep links, see Brief Search Deep Link in the Ex Libris Developer Network.
    To embed a Primo Search box in an HTML file:
    1. Embed the following link in a <form> element of any HTML file:
      The following example embeds a simple Search box that will display the Primo results on the same page:

      <script type="text/javascript">
            function searchPrimo() {
                   document.getElementById("primoQuery").value = "any,contains," + document.getElementById("primoQueryTemp").value;
            function searchKeyPress(e) {
                  if (typeof e == 'undefined' && window.event) {
                        e = window.event;
                  if (e.keyCode == 13) {

      <p><b>Search for</b></p>
      <form name="searchForm" role="search" method="get" action="http://<FE_Hostname>:<FE_port>/primo_library/libweb/action/" enctype="application/x-www-form-urlencoded; charset=utf-8" id="simple" target="_self"  onsubmit="searchPrimo()">
          <input name="institution" value="<inst_code>" type="hidden">
          <input name="vid" value="<view_code>" type="hidden">    
          <input type="hidden" id="primoQuery" name="query" />
          <input type="text" size="25" id="primoQueryTemp" value=" " name="queryTemp" onkeypress="return searchPrimoEvent(event);" />
          <input id="go" type="button" value="Search" title="Search" onclick="searchPrimo();" alt="Search">

      The above example includes the institution, vid, and query input parameters, which are required for a Brief Search deep link.
    2. To customize the embedded search box, append additional parameters to the <form> element using the following format:
      <input name="<parameter_name>" value="<parameter_value>" type="hidden">
      For more information on each parameter, see Brief Search Deep Link in the Ex Libris Developer Network.