click history item template (click history)

Description

Define a Handlebars template used to display content of each item inside the click history box.

Values passed to the template are:

  • redirectUrl - URL of the selected item. It will be added in click history

  • title - textContent of the href element for the selected item

  • date - the time difference between the timestamp when the element was clicked and the current timestamp. This will be converted to human-readable sentences, such as "23 hours ago", "50 seconds ago" etc.

  • query - query term used to get search results

Widget contains predefined Handlebars partial templates that can be used:

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

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

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

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

Default value

clickHistoryItem: {
  template: '<a href="{{redirectUrl}}">{{title}}</a> &middot; <span class="text-warning">{{date}}</span><span class="text-muted"> for &quot;{{query}}&quot;</span>'
}

Examples

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