Inserting the Portfolio Search box into an HTML page

If you want to, you can make Portfolio search functionality available from additional web pages by displaying a standalone Portfolio Search box on the webpage. This is helpful if you want to provide a way for patrons to search your library catalog from another HTML page, such as your library’s home page. You implement the standalone Search box by inserting the Search box HTML code snippet into the <body> tag of the webpage at the point where you want the Search box to appear. The HTML code for the standalone Search box places a Search input field and Search button on the webpage at the point where you inserted the code snippet.

You can add code snippets to the HTML to customize the search box. These code snippets are described in Search service parameters. If you are not familiar working with HTML or where to enter the code snippets, contact SirsiDynix Professional Services.

By default, the standalone Search box looks like this:

When users enter a search term in the Search box and press the Search button, they are redirected to the Searching interface where their search results are displayed.

The HTML code for the Search box refers to several library-specific parameters. You will need to configure the standalone Search box code by replacing these values with values that are specific to your library.

To insert the Search box into an HTML page

  1. Copy or enter the code snippet as it appears below into the <body> tag of the HTML page(s) at the point where you want the Search box to appear. You need to customize the ${hostname} and ${profile_name} parameters for your specific Portfolio system.

    Important: You can add or modify parameters within the code snippet according to your specific library’s needs, but SirsiDynix recommends that you only attempt this if you are familiar with HTML form tags and parameters.

    If you choose to modify parameters in the code snippet, do not make changes to the “input id,” “name,” and “maxlength” values for the “q” parameter, or the pointer to the directory on the server where the embedded.search.scv is found (i.e. “/client/embedded.search”).

    <form method="get" id="searchForm" action="http://${hostname}/client/embedded.search/${profile_name}">

        <input type="hidden" name="ln" value="en_US" />

        <input id="q" title="Search For:" maxlength="256" name="q" value="" type="text" accesskey="s" />

        <input value="Search" id="searchButton" class="button" title="Search" type="submit" />

    </form>

    <form method="get" id="searchForm" action="http://${hostname}/client/embedded.search/${profile_name}">

        <input type="hidden" name="ln" value="en_US" />

        <input id="q" title="Search For:" maxlength="256" name="q" value="" type="text" accesskey="s" />

        <input value="Search" id="searchButton" class="button" title="Search" type="submit" />

    </form>

  2. Configure these parameters in the HTML code by replacing the original values with the values that are specific to your library:

    Parameter Description

    hostname

    Specifies the base URL of your Portfolio server.

    profile_name

    Specifies the name of the profile that you want the Search box to target when performing a search (for more information, see Profile URL).

    Note: When replacing the original values in the code snippet, delete the “${ }” surrounding the value.

  3. Optionally, you can also configure this input:

    Parameter Description

    ln

    Specifies which locale to use when loading the search results.

    Note: If the locale that you specify in the code snippet is not configured for the profile that you specify in the code snippet, then the software will use the default locale specified for that profile.

    This input is hidden in the code snippet, but you may expose it to the user if you want to, or remove it if you don’t need it. Additionally, you may add or customize parameters to this code snippet to further control the searching behavior for the Search box. For more information, see Search service parameters.

Related topics