{% extends 'partials/base.html.twig' %} {% block body %} {%- set photo = page.header.photo ? page.media[page.header.photo] : null -%} {%- set social = page.header.social ?? {} -%} {%- set per_page = 9 -%} {%- set all = taxonomy.findTaxonomy({'author': [page.slug]}).order('date', 'desc') -%} {%- set articles = [] -%} {% for r in all %}{% if r.template == 'item' and r.published %}{% set articles = articles|merge([r]) %}{% endif %}{% endfor %} {%- set total = articles|length -%} {%- set total_pages = (total / per_page)|round(0, 'ceil') -%} {%- set current = (uri.query('page') ?: 1) + 0 -%} {% if current < 1 %}{% set current = 1 %}{% endif %} {%- set items = articles|slice((current - 1) * per_page, per_page) -%}