From c89a3b76cd7bc326123cab3d1d5c4222afb41e97 Mon Sep 17 00:00:00 2001
From: "pmoreno.rodriguez"
<60596353+pmoreno-rodriguez@users.noreply.github.com>
Date: Fri, 3 Feb 2023 22:20:11 +0100
Subject: [PATCH] Updated blog template
Modification to show the featured image of the blog page, the title and subtitle if they exist.
---
templates/blog.html.twig | 33 +++++++++++++++++++++++++--------
1 file changed, 25 insertions(+), 8 deletions(-)
diff --git a/templates/blog.html.twig b/templates/blog.html.twig
index dae5a03..075f918 100644
--- a/templates/blog.html.twig
+++ b/templates/blog.html.twig
@@ -13,15 +13,18 @@
{% else %}
{% set show_pagination = true %}
{% endif %}
+{% set image = page.media[page.header.primaryImage] %}
+{% set title = page.title|raw %}
+{# Set page title by taxonomy #}
{% if uri.param('category') %}
- {% set page_title = theme_config.listing_title.taxonomy.category | default('Posts in Category: ') ~ uri.param('category') %}
+ {% set listing_title = 'FUTURE.BLOG.LISTING_TITLE_CATEGORY'|t ~ uri.param('category') %}
{% elseif uri.param('tag') %}
- {% set page_title = theme_config.listing_title.taxonomy.tag | default('Posts with Tag: ') ~ uri.param('tag') %}
+ {% set listing_title = 'FUTURE.BLOG.LISTING_TITLE_TAG'|t ~ uri.param('tag') %}
{% elseif uri.param('author') %}
- {% set page_title = theme_config.listing_title.taxonomy.author | default('Posts from Author: ') ~ uri.param('author') %}
+ {% set listing_title = 'FUTURE.BLOG.LISTING_TITLE_AUTHOR'|t ~ uri.param('author') %}
{% else %}
- {% set page_title = theme_config.listing_title.blog | default('') %}
+ {% set listing_title = page.header.subtitle|raw %}
{% endif %}
{% if base_url == '/' %}
@@ -37,14 +40,28 @@
{% endblock %}
{% block content %}
+
+ {{ listing_title|raw }}{{ title }}
+ {% if listing_title %}
+