Question and Answers in search
Activate Questions in search
By adding entitytype: 'all' to the parameters the search will mix page recommendations and Questions.
<script>
__rekai.ready(function() {
var rekAutocomplete = rekai_autocomplete('#search-input', {
params: {
entitytype: 'all'
}
});
});
</script>
Sitevision: Activate Questions in search
To activate Questions & Answers in search you can either do it with just one click in "Global settings" as shown below:
Or by using this codesnippet:
<script src="https://static.rekai.se/files/sv-autocomplete.min.js"></script>
<script>
svDocReady(function() {
$svjq(".sv-searchform-portlet input[name='query']").rekAutoComplete({
params: {
entitytype: 'all'
},
sendToTarget: true // Click on result shall go directly to the page
});
});
</script>
Divide questions with a header
To make it clearer when questions are added to the search, you can add a header via CSS:
<style>
.rek-sv-autocomplete .rekai-accordion__header:first-of-type::before {
content: "Frågor och svar";
display: block;
font-size: 1.8rem;
margin-bottom: 4px;
margin-left: 19px;
font-weight: 600;
margin-top: 8px;
}
</style>