{% extends '@nucleus/partials/particle.html.twig' %} {% set attr_extra = particle.extra|attribute_array %} {% set article_settings = particle.article %} {% set filter = article_settings.filter %} {% set sort = article_settings.sort %} {% set limit = article_settings.limit %} {% set start = limit.start + max(0, ajax.start|int) %} {% set display = article_settings.display %} {% set collection = grav.page.collection( { items: {'@taxonomy.category': filter.categories|split(' ')}, order: {by: sort.orderby, dir: sort.ordering}, url_taxonomy_filters: false }, false) %} {% set total = collection.count() %} {% set pages = collection.slice(start, limit.total) %} {% block particle %} {# All pages #}
{% for column in pages.batch(limit.columns) %}
{% for page in column %}
{% if display.image.enabled %} {% if display.image.enabled == 'intro' %} {% set file = page.header.image.summary.enabled|defined(false) ? (page.header.image.summary.file ?: true) %} {% elseif display.image.enabled == 'full' %} {% set file = page.header.image.text.enabled|defined(false) ? (page.header.image.text.file ?: true) %} {% endif %} {% set image = file is same as(true) ? page.media.images|first : (file ? page.media.images[file]) %} {% if image %} {% endif %} {% endif %} {% if display.title.enabled %} {% endif %} {% if display.date.enabled or (display.author.enabled and (page.header.author.username or page.header.author.name or page.header.author.alias)) or display.category.enabled %}
{% if display.date.enabled %} {% if display.date.enabled == 'published' %} {{ page.publishDate()|date(display.date.format) }} {% elseif display.date.enabled == 'modified' %} {{ page.modified|date(display.date.format) }} {% else %} {{ page.date|date(display.date.format) }} {% endif %} {% endif %} {% if display.author.enabled and (page.header.author.username or page.header.author.name or page.header.author.alias) %} {% if page.header.author.name %} {% set author = page.header.author.name %} {% elseif page.header.author.alias %} {% set author = page.header.author.alias %} {% else %} {% set author = page.header.author.username %} {% endif %} {{ author }} {% endif %} {% if display.category.enabled %} {% for category in page.taxonomy.category %} {% if display.category.route %} {{ category|raw }} {% else %} {{ category|raw }} {% endif %} {% endfor %} {% endif %}
{% endif %} {% if display.text.type %} {% set page_text = display.text.type == 'intro' ? page.summary : page.content %}
{% if display.text.formatting == 'text' %} {{ page_text|truncate_text(display.text.limit)|raw }} {% else %} {{ page_text|truncate_html(display.text.limit)|raw }} {% endif %}
{% endif %} {% if display.read_more.enabled %} {% endif %}
{% endfor %}
{% endfor %} {% if total > limit.total and display.pagination_buttons %}
{% endif %}
{% endblock %} {% block javascript_footer %} {% if total > limit.total and display.pagination_buttons %} {% do gantry.load('jquery') %} {% endif %} {% endblock %}