Dusty Candland | Sat Nov 14 2020 Search as you type autocomplete

Search as you type autocomplete

Today we released support for search as you type suggestions / autocomplete. When a search is being entered we'll return suggested pages automatically.

Suggestions are enabled by default, but can be turned off with options.

var CshConf = {
token: "TOKEN",
showSuggestions: false
};

You can override the default template using this following configuration setting. You do need to keep the csh-sg id on the template.


var suggestTemplate = `
<div id="csh-sg" class="csh-suggest">
{{#urls}}
<div>
<a class="csh-link" href="{{ url }}" data-rank="{{ index }}">{{ title }}</a>
</div>
{{/urls}}
</div>
`


var CshConf = {
token: "TOKEN",
suggestTemplate: suggestTemplate
};

Please reach out with any questions!