From d0f71738a2a01cbf6d9d8b9f5d3428836a5f52ad Mon Sep 17 00:00:00 2001 From: "pmoreno.rodriguez" <60596353+pmoreno-rodriguez@users.noreply.github.com> Date: Mon, 9 Jan 2023 21:21:12 +0100 Subject: [PATCH] Added page.header.metadata.author to blog_item template --- templates/partials/blog_item.html.twig | 79 +++++++++++++------------- 1 file changed, 40 insertions(+), 39 deletions(-) diff --git a/templates/partials/blog_item.html.twig b/templates/partials/blog_item.html.twig index 38dd6e9..2c58db3 100644 --- a/templates/partials/blog_item.html.twig +++ b/templates/partials/blog_item.html.twig @@ -1,25 +1,29 @@
- {% if page.header.author %} - {% set author = page.header.author %} - {% else %} - {% set author = page.header.taxonomy.author[0] %} - {% endif %} - {% if author %} - {% set avatar = author|replace(' ', '-')|lower %} - {% endif %} + + {% if page.header.metadata.author %} + {% set author = page.header.metadata.author %} + {% elseif page.header.author %} + {% set author = page.header.author %} + {% else %} + {% set author = page.header.taxonomy.author[0] %} + {% endif %} + + {% if author %} + {% set avatar = author|replace(' ', '-')|lower %} + {% endif %}
- {% if page.header.link %} -

- {% if page.header.continue_link is not sameas(false) %} - - {% endif %} - {{ page.title }} -

- {% else %} -

{{ page.title }}

- {% endif %} + {% if page.header.link %} +

+ {% if page.header.continue_link is not sameas(false) %} + + {% endif %} + {{ page.title }} +

+ {% else %} +

{{ page.title }}

+ {% endif %} {% if page.header.subtitle %}

{{ page.header.subtitle|raw }}

{% endif %} @@ -27,18 +31,17 @@
- {% if page.header.primaryImage %} - {{ page.media[page.header.primaryImage].cropZoom(1038,437).loading('lazy').html(page.title, page.title, 'image featured')|raw }} - {% else %} - {{ page.media.images|first.cropZoom(1038,437).loading('lazy').html(page.title, page.title, 'image featured')|raw }} - {% endif %} + {% if page.header.primaryImage %} + {{ page.media[page.header.primaryImage].cropZoom(1038,437).loading('lazy').html(page.title, page.title, 'image featured')|raw }} + {% else %} + {{ page.media.images|first.cropZoom(1038,437).loading('lazy').html(page.title, page.title, 'image featured')|raw }} + {% endif %} -
{% if page.header.continue_link is sameas(false) %} @@ -66,28 +69,26 @@ {% endif %} {% if show_prev_next %} - {% if not page.isLast %} -
  • {{'FUTURE.BLOG.ITEM.PREV_POST'|t}}
  • - {% endif %} - {% if not page.isFirst %} -
  • {{'FUTURE.BLOG.ITEM.NEXT_POST'|t}}
  • - {% endif %} + {% if not page.isLast %} +
  • {{'FUTURE.BLOG.ITEM.PREV_POST'|t}}
  • + {% endif %} + {% if not page.isFirst %} +
  • {{'FUTURE.BLOG.ITEM.NEXT_POST'|t}}
  • + {% endif %} {% endif %} - - -
    + \ No newline at end of file