google-appliance-search-results.html.twig in Google Search Appliance 8
Contains theme representation of search results
Available variables:
- form - the search form
- results - the search results
1 theme call to google-appliance-search-results.html.twig
- SearchViewController::get in src/
Controller/ SearchViewController.php - Builds search page.
File
templates/google-appliance-search-results.html.twigView source
- {#
- /**
- * @file
- * Contains theme representation of search results
- *
- * Available variables:
- * - form - the search form
- * - results - the search results
- */
- #}
- <div>
- <div>
- {{ form }}
- </div>
- <h2 id="search-results-heading">{{ results.getSearchTitle }}</h2>
- <div>
- {% if results.hasSpellingSuggestions %}
- <ol>
- {% for suggestion in results.getSpellingSuggestions %}
- {# @todo split into own tpl #}
- <li>{{ suggestion }}</li>
- {% endfor %}
- </ol>
- {% endif %}
- </div>
- <div>
- {% if results.hasSynonyms %}
- <div class="synonyms google-appliance-synonyms">
- <span class="p">You may also try:</span>
- <ul>
- {% for synonym in results.getSynonyms %}
- <li>{{ synonym.getLink }}</li>
- {% endfor %}
- </ul>
- </div>
- {% endif %}
- </div>
- <div>
- {{ pager }}
- </div>
- <div>
- {% include '@google_appliance/google-appliance-results-control-bar.html.twig' with {
- results: results,
- } only %}
- {% if results.hasKeyMatch %}
- <ol class="keymatch-results google-appliance-keymatch-results">
- {# @todo: keymatch results #}
- </ol>
- {% endif %}
-
- {% if results.hasErrors %}
- {# @todo
- <span>Errors</span>
- <ol>
- {% for type, item in error %}
- <li>{{ type }}, :{{ item }}</li>
- {% endfor %}
- </ol>#}
- {% endif %}
-
- {% if results.hasResults %}
- <ol class="search-results google-appliance-results">
- {% for result in results.getResults %}
- <li class="search-result">{% include '@google_appliance/google-appliance-result.html.twig' with {
- result: result,
- } only %}</li>
- {% endfor %}
- </ol>
- {% else %}
- <span>No results found.</span>
- {% endif %}
-
- {% include '@google_appliance/google-appliance-results-control-bar.html.twig' with {
- results: results,
- } only %}
- </div>
- {{ results.getPager }}
- </div>