Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autosuggest: Document window.epAutosuggestItemHTMLFilter #2776

Closed
felipeelia opened this issue May 18, 2022 · 1 comment · Fixed by #2902
Closed

Autosuggest: Document window.epAutosuggestItemHTMLFilter #2776

felipeelia opened this issue May 18, 2022 · 1 comment · Fixed by #2902
Assignees
Labels
enhancement module:autosuggest Issues related to the Autosuggest functionality needs documentation
Milestone

Comments

@felipeelia
Copy link
Member

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>';
}
@felipeelia felipeelia added enhancement needs documentation module:autosuggest Issues related to the Autosuggest functionality labels May 18, 2022
@felipeelia felipeelia added this to the 4.3.0 milestone May 18, 2022
@MARQAS
Copy link
Contributor

MARQAS commented May 19, 2022

I'll look into this and will add documentation on how to use it properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement module:autosuggest Issues related to the Autosuggest functionality needs documentation
Projects
None yet
4 participants