About Features Downloads Getting Started Documentation Events Support GitHub

Love VuFind®? Consider becoming a financial supporter. Your support helps build a better VuFind®!

Site Tools


Warning: This page has not been updated in over over a year and may be outdated or deprecated.
administration:linking_to_vufind_from_external_systems

Linking to VuFind from External Systems

It is often useful to have link templates that allow other systems (such as resource sharing environments, third-party databases, etc.) to link to content within your VuFind instance. Fortunately, VuFind URLs are structured in a way that makes this fairly simple.

Records

All record links should be of the form http://[your-vufind-server]/[your-vufind-path]/Record/[record-id]. For example, http://vufind.org/demo/Record/12345.

Searches

All search links should be of the form http://[your-vufind-server]/[your-vufind-path]/Search/Results?type=[search-type]&lookfor=[query]. For example, http://vufind.org/demo/Search/Results?type=Author&lookfor=Smith,+John.

Valid values for [search-type] may be found by consulting your searchspecs.yaml configuration file – or, for a simpler approach, just perform a search of the type you desire and copy and paste the resulting URL.

Complex Searches

More complicated searches can be constructed by specifying arrays of lookfor/type/bool parameters with numbered groups:

lookfor<N>[]= array of search terms in group N
type<N>[]= array of search fields in group N
bool<N>[]= boolean operator used by group N (AND/OR/NOT)

Additionally a top level operator can be specified between groups using the join parameter:

join= (AND/OR)

Thus a search like “(title:foo OR author:bar) AND (NOT subject:baz)” can be represented as:

http://[your-vufind-server]/[your-vufind-path]/Search/Results?join=AND&lookfor0[]=foo&type0[]=title&lookfor0[]=bar&type0[]=author&bool0[]=OR&lookfor1[]=baz&type1[]=subject&bool1[]=NOT

The <N>[] syntax allows the repeated parameters to be amassed together, by group number. The square brackets ([]) may be encoded in the URL's query string as %5B%5D.

Search Widgets

You can easily perform a VuFind search from a third-party site by simply copying the search form HTML generated by VuFind. Just follow these steps:

1.) Go to your VuFind home page and view the source in your browser.

2.) Copy the form containing the search box. It should look something like this:

          <form method="get" action="/demo/Search/Results" name="searchForm" id="searchForm" class="search">
      <label for="searchForm_lookfor" class="offscreen">Your search terms</label>
      <input id="searchForm_lookfor" type="text" name="lookfor" size="40" value="" class="autocomplete searcher:Solr typeSelector:searchForm_type"/>
      <label for="searchForm_type" class="offscreen">Search Type</label>
              <select id="searchForm_type" name="type" data-native-menu="false">
                      <option value="AllFields">All Fields</option>
                      <option value="Title">Title</option>
                      <option value="Author">Author</option>
                      <option value="Subject">Subject</option>
                      <option value="CallNumber">Call Number</option>
                      <option value="ISN">ISBN/ISSN</option>
                      <option value="tag">Tag</option>
                  </select>
            <input type="submit" name="submit" value="Find"/>
              <a href="/demo/Search/Advanced" class="small">Advanced</a>
      
                            </form>

3.) Change the action attribute of the <form> tag to include the full URL of your VuFind instance (e.g. in the example above, add http://vufind.org to the front of the action).

You can add hidden input elements to the form if you wish to pre-set filters, force a particular search type, etc.

administration/linking_to_vufind_from_external_systems.txt · Last modified: 2022/10/14 19:44 by ejbivona