recent item template (recent searches)

Description

Define a Handlebars template used to display each item inside the recent search history box.

Values passed to the template are:

  • searchParams - query parameters used for search

  • total - total number of search results for given query

  • query - query term used to get search results

  • isFacetApplied - boolean value (true if facets are applied in search, false otherwise)

  • icon - content of filter icon

Widget contains predefined Handlebars partial templates that can be used:

  • {{searchParams}} - display {{searchParams}} from data model passed to template

  • {{total}} - display {{total}} from data model passed to template

  • {{query}} - display {{query}} from data model passed to template

  • {{isFacetApplied}} - use value from data model passed to template to calculate whether to display filter icon

  • {{icon}} - display {{icon}} from data model passed to template

Default value

searchHistoryRecentItem: {
  template: '<a href="?{{searchParams}}">{{query}} <small>({{total}})</small></a>{{#if isFacetApplied}}<i class="{{icon}}"></i>{{/if}}'
}

Examples

searchHistoryRecentItem: {
    template: '<a href="{{redirectUrl}}">{{title}}</a>-<span class="text-info">{{date}}</span><span class="text-muted"> for <b>{{query}}</b></span>'
},