You are here

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

File

templates/google-appliance-search-results.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Contains theme representation of search results
  5. *
  6. * Available variables:
  7. * - form - the search form
  8. * - results - the search results
  9. */
  10. #}
  11. <div>
  12. <div>
  13. {{ form }}
  14. </div>
  15. <h2 id="search-results-heading">{{ results.getSearchTitle }}</h2>
  16. <div>
  17. {% if results.hasSpellingSuggestions %}
  18. <ol>
  19. {% for suggestion in results.getSpellingSuggestions %}
  20. {# @todo split into own tpl #}
  21. <li>{{ suggestion }}</li>
  22. {% endfor %}
  23. </ol>
  24. {% endif %}
  25. </div>
  26. <div>
  27. {% if results.hasSynonyms %}
  28. <div class="synonyms google-appliance-synonyms">
  29. <span class="p">You may also try:</span>
  30. <ul>
  31. {% for synonym in results.getSynonyms %}
  32. <li>{{ synonym.getLink }}</li>
  33. {% endfor %}
  34. </ul>
  35. </div>
  36. {% endif %}
  37. </div>
  38. <div>
  39. {{ pager }}
  40. </div>
  41. <div>
  42. {% include '@google_appliance/google-appliance-results-control-bar.html.twig' with {
  43. results: results,
  44. } only %}
  45. {% if results.hasKeyMatch %}
  46. <ol class="keymatch-results google-appliance-keymatch-results">
  47. {# @todo: keymatch results #}
  48. </ol>
  49. {% endif %}
  50. {% if results.hasErrors %}
  51. {# @todo
  52. <span>Errors</span>
  53. <ol>
  54. {% for type, item in error %}
  55. <li>{{ type }}, :{{ item }}</li>
  56. {% endfor %}
  57. </ol>#}
  58. {% endif %}
  59. {% if results.hasResults %}
  60. <ol class="search-results google-appliance-results">
  61. {% for result in results.getResults %}
  62. <li class="search-result">{% include '@google_appliance/google-appliance-result.html.twig' with {
  63. result: result,
  64. } only %}</li>
  65. {% endfor %}
  66. </ol>
  67. {% else %}
  68. <span>No results found.</span>
  69. {% endif %}
  70. {% include '@google_appliance/google-appliance-results-control-bar.html.twig' with {
  71. results: results,
  72. } only %}
  73. </div>
  74. {{ results.getPager }}
  75. </div>