{% trans_default_domain 'ibexa_search' %} {% if results is defined %} {% if results is empty %} {% set no_results_hints = [ 'search.no_results.hint.check_spelling'|trans|desc('Check the spelling of keywords.'), 'search.no_results.hint.more_general'|trans|desc('Try more general keywords.'), 'search.no_results.hint.different_kewords'|trans|desc('Try different keywords.'), 'search.no_results.hint.fewer_keywords'|trans|desc('Try fewer keywords. Reducing keywords results in more matches.'), ] %}

{{ 'search.no_results.title'|trans({'%query%': form.query.vars.value})|desc('No results found for "%query%"') }}

{% include '@ibexadesign/ui/search/spellcheck.html.twig' %}
{% for hint in no_results_hints %}
{{ hint }}
{% endfor %}
{{ form_widget(form.sort, { attr: { dropdown_hidden: true }}) }} {% else %}
{% set body_rows = [] %} {% for result in results %} {% set body_row_cols = [] %} {% set col_raw %} {% endset %} {% set body_row_cols = body_row_cols|merge([{ has_icon: true, content: col_raw, raw: true, }]) %} {% set col_raw %} {% if result.mainLocationId is not null %} {{ result.name }} {% else %} {{ result.name }} {% endif %} {% endset %} {% set body_row_cols = body_row_cols|merge([{ content: col_raw, raw: true, }]) %} {% set body_row_cols = body_row_cols|merge([ { content: result.modified|ibexa_full_datetime }, { content: result.type }, ]) %} {% set col_translation %} {% if result.mainLocationId is not null %} {% set main_language_code = result.translation_language_code %} {% set other_language_translations = result.available_enabled_translations|filter(translation => translation.languageCode != main_language_code) %} {{ result.available_translations[main_language_code].name }} {% if other_language_translations|length > 0 %}
{% for other_language_translation in other_language_translations %} {{ other_language_translation.name }} {% if not loop.last %} {{ ',' }} {% endif %} {% endfor %}
{% endif %} {% else %} {{ result.available_translations[result.translation_language_code].name }} {% endif %} {% endset %} {% set body_row_cols = body_row_cols|merge([{ content: col_translation, raw: true, }]) %} {% set col_raw %} {% set path_locations = ibexa_path_to_locations(result.resolvedLocation.pathString) %} {% set result_breadcrumbs = '' %} {% for location in path_locations %} {% set result_breadcrumbs = result_breadcrumbs ~ ibexa_content_name(location.contentInfo) %} {% if not loop.last %} {% set result_breadcrumbs = result_breadcrumbs ~ ' / ' %} {% endif %} {% endfor %} {{ result_breadcrumbs }} {% endset %} {% set body_row_cols = body_row_cols|merge([{ content: col_raw, raw: true, }]) %} {% set col_raw %} {% if result.mainLocationId is not null %} {% include '@ibexadesign/ui/edit_translation_button.html.twig' with { 'contentId': result.contentId, 'translations': result.available_enabled_translations, }%} {% endif %} {% endset %} {% set body_row_cols = body_row_cols|merge([{ has_action_btns: true, content: col_raw, raw: true, }]) %} {% set body_rows = body_rows|merge([{ cols: body_row_cols }]) %} {% endfor %} {% set head_cols = [ { has_icon: true }, { content: 'search.name'|trans|desc('Name') }, { content: 'search.modified'|trans|desc('Modified') }, { content: 'search.type'|trans|desc('Content type') }, { content: 'search.translation'|trans|desc('Translation') }, { content: 'search.location'|trans|desc('Location') }, { }, ] %} {% set actions %} {{ form_widget(form.sort, { attr: { class: 'ibexa-search-form__sort-order-select' }}) }} {% endset %} {% embed '@ibexadesign/ui/component/table/table.html.twig' with { headline: 'search.results_for'|trans({ '%total%': pager.nbResults, '%search_phrase%': form.vars.data.query, })|desc('Results for “%search_phrase%” (%total%)'), head_cols: head_cols, body_rows: body_rows, actions, } %} {% trans_default_domain 'ibexa_search' %} {% block between_header_and_table %}
{% include '@ibexadesign/ui/search/criteria_tags.html.twig' %} {% include '@ibexadesign/ui/search/spellcheck.html.twig' %}
{% endblock %} {% endembed %} {% if pager.haveToPaginate %} {% include '@ibexadesign/ui/pagination.html.twig' with { 'pager': pager, 'paginaton_params' : { 'pageParameter': '[search][page]' } } %} {% endif %}
{% endif %} {% else %}

{{ 'search.empty.title'|trans|desc('No search items') }}

{{ 'search.empty.subtitle'|trans|desc('Enter the phrase to find') }}
{{ form_widget(form.sort, { attr: { dropdown_hidden: true }}) }} {% endif %}