q4.searchResults
*Latest Version Update: 5.21.0 * Q4 Search Widget implementation.
- Script link
- q4.search.5.21.0.min.js
- Source file
- q4.search.js, line 19
- Requires
Examples
$('.module-search-results').q4Search({
url: '/api/Search/', //API Endpoint
languageId: '',
loadingMessage: '<p>Loading...</p>',
noResultsFound: '<p>No results found.</p>',
dateErrorMessage: '<p>Date range is invalid.</p>',
perPageSelectElem: '.form_field--pages select',
contentTypeSelectElem: '.form_field--content select',
sortSelectElem: '.form_field--sort select',
searchInputElem: '.form_field--search input',
dateInputElem: '.form_field--date input',
searchResultContainer: '.module-search-results_result',
pagerContainer: '.pager_list',
descriptionLength: '250',
defaultContentType: '', //blank is all categories, based on select option values
defaultSort: 'relevance', // relevance, dateAscending, dateDescending
defaultPageSize: '10',
enableDateRangePicker: true,
dateRangePickerOptions: {
"showDropdowns": false,
"buttonClasses": "button",
"applyButtonClasses": "button--apply",
"cancelClass": "button--cancel"
},
searchInputOverrideElem: '',
showAggregateOnTypes: true, //shows the number of results per content type
resetDateOnSearch: true, //resets date field when new search term is entered
beforeRender: function (e, data) { },
complete: function (e) { }
});