Conditionally Change Label Filters by Search Term When Limiting Web Widget Results?
I was reading information about how to limit search results in the web widget. We have an edge case version of this scenario where we want to default to limiting
For example, we have a lot of articles that apply to all customers. And we have a handful of client-specific articles that only apply to customers of that specific client. These articles have two different labels: generic-articles and client-specific-articles. I want to try and find a way to conditionally change the labels involved so that the specific articles don't show up at all unless you search for a client by name. Is this possible?
I was thinking something akin to this:
<script type="text/JavaScript">
window.zESettings = {
webWidget: {
helpCenter: {
filter: {
{{#if zE('webWidget', 'helpCenter:setSuggestions', { search: '%client-name-1%' });}}
label_names: 'generic-articles', 'client-specific articles'
{{#if zE('webWidget', 'helpCenter:setSuggestions', { search: '%client-name-2%' });}}
label_names: 'generic-articles', 'client-specific articles'
{{else}}
label_names: 'generic-articles'
{{/if}}
}
}
}
};
</script>
投稿コメントは受け付けていません。
0 コメント