{% extends 'partials/_master.twig' %} {% block main %}
{# This template is used for search results. If 'search' is defined, we display an appropriate title. The 'records' array contains all of the records matching the current query. If there are no results, the code in the 'else' part of the for-loop is used. #}

{% if search is not empty %} {{ __('general.phrase.search-results-for-variable', { '%search%': search }) }} {% else %} {{ __('general.phrase.search') }} {% endif %}

{# Perhaps we post a small teaser, stored in the 'block' named 'Search teaser' #} {% setcontent block = "block/search-teaser" %} {# check if we have 'content'. If so, we know we have have a teaser to display. #} {% if block.content is defined %}
{{ block.content }}
{% endif %}
{% for record in records %}

{{ record.title }}

{% if record.editlink() %} Edit • {% endif %} {{ __('general.phrase.permalink') }} • {{ __('general.phrase.written-by-on', { '%name%': record.user.displayname|default(__('Unknown')), '%date%': record.datepublish|localedatetime("%A %B %e, %Y") }) }}

{# display something introduction-like.. #}

{{ record.excerpt(300, false, search|default('')) }}

{% if record.image is not empty %}
{{ record.values.image.alt|default() }}
{% endif %}
{% else %}

{{ __('general.phrase.no-result-for-search-term', { '%SEARCHTERM%': search|escape }) }}

{% endfor %} {# If there are more records than will fit on one page, the pager is shown. #} {{ pager(template = 'partials/_sub_pager.twig') }}
{% endblock main %}