ideas
ideas copied to clipboard
Allow accessing supplemental data from search tag
- Currently, the
search:resultstag goes straight into looping over the results - However, it would make sense to split things into 1) general search result data and 2) the actual result array
- Example: display search facets (like available sizes or distribution across categories) above results, then loop over results
Current
{{ search:results }}
{{# No way to show distributions and facets :( #}}
<a href="{{ url }}" class="result">
<h2>{{ title }}</h2>
<p>{{ content | truncate:240 }}</p>
</a>
{{ /search:results }}
Suggested
Assuming a product search using a driver that provides facets:
{{ search }}
{{ facets }}
Sizes: {{ size:min }}—{{ size:max }}
{{ /facets }}
{{ results }}
<a href="{{ url }}" class="result">
<h2>{{ title }}</h2>
<p>Size {{ size }}</p>
</a>
{{ /results }}
{{ /search }}