Skip to main content
ExLibris

Knowledge Assistant

BETA
 
  • Subscribe by RSS
  • Back
    Primo

     

    Ex Libris Knowledge Center
    1. Search site
      Go back to previous article
      1. Sign in
        • Sign in
        • Forgot password
    1. Home
    2. Primo
    3. Product Documentation
    4. Primo
    5. Technical Guide
    6. Embedding the Primo Search into a Local Site
    7. Embedding a Primo Search Box

    Embedding a Primo Search Box

    1. Last updated
    2. Save as PDF
    3. Share
      1. Share
      2. Tweet
      3. Share
    No headers

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

    Return to menu
    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.
    PrimoSearchBox3.png
    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:
      http://FE_hostname:port/primo_library/libweb/action/dlSearch.do?
      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;
                   document.forms["searchForm"].submit();
            }
            
            function searchKeyPress(e) {
                  if (typeof e == 'undefined' && window.event) {
                        e = window.event;
                  }
                  if (e.keyCode == 13) {
                        document.getElementById('go').click();
                  }
            }
      </script>

      <p><b>Search for</b></p>
      <form name="searchForm" role="search" method="get" action="http://<FE_Hostname>:<FE_port>/primo_library/libweb/action/dlSearch.do" 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">
      </form>

      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.
    View article in the Exlibris Knowledge Center
    1. Back to top
      • Embedding the Primo Search into a Local Site
      • Embedding a Primo Search Tile
    • Was this article helpful?

    Recommended articles

    1. Article type
      Topic
      Content Type
      Documentation
      Language
      English
      Product
      Primo
    2. Tags
      1. contype:docum
      2. Embedding the Primo Search into a Local Site
      3. Prod:Primo
      4. Technical Guide
    1. © Copyright 2025 Ex Libris Knowledge Center
    2. Powered by CXone Expert ®
    • Term of Use
    • Privacy Policy
    • Contact Us
    2025 Ex Libris. All rights reserved