-
-
Save rosiegrant/cc4d5c44ade70fa24249d09e834b7cc5 to your computer and use it in GitHub Desktop.
Default Template for No Results in Answers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// New Template | |
verticals: { | |
events: { | |
sectionTitle: 'Ballroom Events', | |
noResults: { | |
displayAllResults: true, | |
template: ` | |
<div class="yxt-AlternativeVerticals{{#unless isShowingResults}} yxt-AlternativeVerticals--notShowingResults{{/unless}}"> | |
<div class="yxt-AlternativeVerticals-noResultsInfo"> | |
<em class="yxt-AlternativeVerticals-noResultsInfo--emphasized"> | |
No results found | |
</em> | |
in {{currentVerticalLabel}}. | |
{{#if isShowingResults}}Showing <em class="yxt-AlternativeVerticals-noResultsInfo--emphasized">all {{currentVerticalLabel}}</em> instead.{{/if}} | |
</div> | |
{{#if verticalSuggestions}} | |
<div class="yxt-AlternativeVerticals-suggestionsWrapper"> | |
<div class="yxt-AlternativeVerticals-details"> | |
The following search | |
{{plural verticalSuggestions.length 'category' 'categories'}} | |
yielded results | |
{{#if query}} | |
for | |
<span class="yxt-AlternativeVerticals-details--query"> | |
"{{query}}"</span>: | |
{{/if}} | |
</div> | |
<ul class="yxt-AlternativeVerticals-suggestionsList"> | |
{{#each verticalSuggestions}} | |
<li class="yxt-AlternativeVerticals-suggestion"> | |
<a class="yxt-AlternativeVerticals-suggestionLink" | |
href="{{url}}"> | |
{{#if iconName}} | |
<div class="yxt-AlternativeVerticals-verticalIconWrapper" | |
data-component="IconComponent" | |
data-opts='{ | |
"iconName": "{{iconName}}" | |
}'> | |
</div> | |
{{/if}} | |
<div class="yxt-AlternativeVerticals-suggestionLink--copy"> | |
<span class="yxt-AlternativeVerticals-suggestionLink--copyLabel"> | |
{{label}} | |
</span> | |
<span class="yxt-AlternativeVerticals-suggestionLink--copyResults"> | |
({{resultsCount}} {{plural resultsCount 'result' 'results'}}) | |
</span> | |
</div> | |
<div class="yxt-AlternativeVerticals-arrowIconWrapper" | |
data-component="IconComponent" | |
data-opts='{ | |
"iconName": "chevron" | |
}'> | |
</div> | |
</a> | |
</li> | |
{{/each}} | |
</ul> | |
{{#if universalUrl}} | |
<div class="yxt-AlternativeVerticals-universalDetails"> | |
Alternatively, you can | |
<a class="yxt-AlternativeVerticals-universalLink" | |
href={{universalUrl}}> | |
view results across all search categories</a>. | |
</div> | |
{{/if}} | |
</div> | |
{{/if}} | |
</div> | |
` | |
} | |
} | |
} | |
// Old Template | |
verticals: { | |
events: { | |
sectionTitle: 'Ballroom Events', | |
noResults: { | |
displayAllResults: false, | |
template: ` | |
<div class="yxt-NoResults"> | |
<div class="yxt-NoResults-wrapper"> | |
<p class="yxt-NoResults-info"> | |
Your search - <span class="yxt-NoResults-query">{{query}}</span> - did not match any answers we have. | |
</p> | |
{{#if universalUrl}} | |
<p class="yxt-NoResults-returnLinkWrapper"> | |
Try refining your query or <a href="{{universalUrl}}" class="yxt-NoResults-returnLink">search all content.</a> | |
</p> | |
{{/if}} | |
<div class="yxt-NoResults-suggestions"> | |
<p class="yxt-NoResults-suggestionsHeader"> | |
Suggestions: | |
</p> | |
<ul class="yxt-NoResults-suggestionsList"> | |
<li class="yxt-NoResults-suggestion">Make sure all words are spelled correctly.</li> | |
<li class="yxt-NoResults-suggestion">Try to ask your question a different way.</li> | |
<li class="yxt-NoResults-suggestion">Try more general words.</li> | |
<li class="yxt-NoResults-suggestion">Try fewer words.</li> | |
</ul> | |
</div> | |
</div> | |
</div> | |
` | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment