{% extends "ContentManagementBundle::layout.html.twig" %} {% block page_title %}{{ 'Search results for'|trans }}: {{ queryString }} - {{ parent() }}{% endblock %} {% block content %} {% if facets|length > 0 %} {% for facetName, facetValues in facets %}
{% endfor %} {% endif %}
{{ 'global.titles.there_are'|trans }} {{ resultsCount }} {{ 'Results for'|trans }}: {{ queryString }}
{% if suggestedQueryString %}
{{ 'Did you mean'|trans }}: {{ suggestedQueryString }}
{% endif %} {% if resultsCount == 0 %}

{{ 'No Search Results Found'|trans }}

{{ 'Here are a few tips to perform a better search'|trans }}:

{% endif %} {% if resultsCount > 0 %}
{% for group in resultsGroups %} {% if groupedSearch %}

{{ (group.classification == 'entry' ? 'content_type.' ~ group.type ~ '.list_name' : (group.classification == 'collection' ? 'content_type.' ~ group.type ~ '.n' : 'search.' ~ group.type))|trans }} {% if group.count > 5 %} {{ group.count }} {{ 'Result(s)'|trans }} {% endif %}

{% endif %} {% endfor %} {% if viewPager %} {% set currentPage = app.request.get('page', 1) %} {% set startPage = max(1, currentPage - 2) %} {% set lastPage = (resultsCount / pageSize)|round(0, 'ceil') %} {% set endPage = min(startPage + 4, lastPage) %} {% endif %}
{% endif %}
{% endblock %} {% block js_document_ready %} {{ parent() }} {% if facets|length > 0 %} parseUrlParams(); var facets = ["{{ facets|keys|join('", "')|raw }}"]; $.each(facets, function(idx, facet) {console.log(facet); $('select[name="' + facet + '"]').change(function() {console.log(facet); window.urlParams[facet] = $(this).val(); window.location.href = window.location.pathname + '?' + $.param(window.urlParams); }); }); {% endif %} {% endblock %}