From 7bcd5189b0c07767d704197f1e63d98f21b88167 Mon Sep 17 00:00:00 2001 From: "pmoreno.rodriguez" <60596353+pmoreno-rodriguez@users.noreply.github.com> Date: Fri, 3 Feb 2023 23:24:24 +0100 Subject: [PATCH] Improved the definition of variables. Improved the definition of title, subtitle and image variables. --- templates/portfolio.html.twig | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/templates/portfolio.html.twig b/templates/portfolio.html.twig index 967fa24..acd5b9b 100644 --- a/templates/portfolio.html.twig +++ b/templates/portfolio.html.twig @@ -1,5 +1,7 @@ {% extends 'partials/base.html.twig' %} - +{% set image = page.media[page.header.primaryImage] %} +{% set title = page.title|raw %} +{% set subtitle = page.header.subtitle|raw %} {% set columns = page.header.layout == 'standard' ? 'col-4 col-6-medium col-12-small' : 'col-6 col-12-small' %} {% block menu %} @@ -11,14 +13,14 @@
-

{{ page.header.title }}

- {% if page.header.subtitle %} -

{{ page.header.subtitle }}

+

{{ title }}

+ {% if subtitle %} +

{{ subtitle }}

{% endif %}
- {% if page.header.primaryImage %} - {{ page.media[page.header.primaryImage].cropZoom(1038,437).loading('lazy').html(page.title, page.title, 'image featured')|raw }} + {% if image %} + {{ image.cropZoom(1038,437).loading('lazy').html(title, title, 'image featured')|raw }} {% endif %} {{ page.content|raw}}