ElasticPress
ElasticPress copied to clipboard
Autosuggest: Document window.epAutosuggestItemHTMLFilter
Is your enhancement related to a problem? Please describe.
Although it is currently possible to change the autosuggest output, we don't have that properly documented.
Describe the solution you'd like An addition to the Theme Integration page seems the best place to explain how to use the window.epAutosuggestItemHTMLFilter function.
An example I've recently shared that can serve as a starting point:
window.epAutosuggestItemHTMLFilter = function(itemHTML, doc, i, value) {
return '<li><a href="' + doc._source.permalink + '"><img src="' + doc._source.thumbnail.src + '">' + doc._source.post_title + '</a></li>';
}
I'll look into this and will add documentation on how to use it properly.