Srophé Application : Documentation

Search Options

Limit by Collection/Series

To limit your search by collection or by TEI series you can edit search.html to change:

<div data-template="search:search-data">


<div data-template="search:search-data" data-template-collection="places">


Maps can be added to any page, i.e. record, search or browse. By inserting the following into the HTML page:

<div data-template="app:display-map"/>

Note, this must be called inside the data template that calls the data, so for search or browse it must come inside of the <div data-template="search:search-data"> or <div data-template="browse:get-all">.

Add paging and sort options.

modules/lib/paging.xqm is the module for displaying page numbers and sort options on the html page. This can be added anywhere on the browse page by adding: <div data-template="app:pageination"/>

You may also add sort options. Currently supported options are:

  • title -> tei:titleStmt/tei:title[1]
  • author -> tei:titleStmt/tei:author[1] or tei:titleStmt/tei:editor[1] if there is no tei:author
  • pubDate -> tei:teiHeader/descendant::tei:imprint[1]/descendant-or-self::tei:date[1]
  • persDate -> /descendant::tei:birth/@syriaca-computed-start or /descendant::tei:death/@syriaca-computed-start

Additional sort options can be added by editing the data:add-sort-options() function in modules/lib/data.xqm.

Sort options should be added to the pagination template using the sort-options paramter:

<div data-template="app:pageination" data-template-sort-options="title,author,pubDate"/>


Facets can be added to any search results page by including:

<div data-template="app:display-facets"/>

For example, on the search page:

<div class="row">
  <div class="col-md-8 col-md-push-4">
    <div data-template="search:show-hits" data-template-kwic="yes"/>
  <div class="col-md-4 col-md-pull-8">
    <div data-template="app:display-facets"/>

HTML search forms

The HTML search form provides advanced search options for the application. The default form provides a search by Keyword, Title and Author. The application also provides a simple configuration file for creating an advanced search form with appropriate XPath filters to be used by the search. See To do more advanced searches, or more complicated XPath filters you will need to add additional functions to modules/lib/data.xqm.

Example of the search-config.xml:

  <!-- Label for search form (optional) -->
    <label>Advanced Search </label>
  <!-- Description for search form (optional) -->
    <desc>Search all TEI data.</desc>
  <!-- Sample form input -->
    <input type="text" label="Title" name="title" element="tei:titleStmt/tei:title" title="Search all TEI Titles" placeholder="Search Title..." keyboard="yes"/>

Input attributes:

  • @type - currently only supports text input
  • @label - the label for the input
  • @name - input name to be submitted by from
  • @element - TEI element or XPath to element to filter search on. This element must be added to the srophe-data/collection.xconf file so that it is indexed by Lucene.
  • @title - used by the helper tool tip (optional)
  • @placeholder - place holder text to appear in input text box. (optional)
  • @keyboard - use foreign language keyboards or not. Keyboards are defined in the repo-config.xml file. (optional)

See more about Keyboard options