From d47b5180825c06789f758a236dcd08e6bfbcaa8d Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Thu, 9 Dec 2021 08:45:43 +0000 Subject: [PATCH] feat: re-add links to event names When there is a link to an event, make the event name clickable so that visitors can find out more about that specific event. --- .../custom/opdavies/templates/paragraph--event.html.twig | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/web/themes/custom/opdavies/templates/paragraph--event.html.twig b/web/themes/custom/opdavies/templates/paragraph--event.html.twig index 28c74d6..3f8bce3 100644 --- a/web/themes/custom/opdavies/templates/paragraph--event.html.twig +++ b/web/themes/custom/opdavies/templates/paragraph--event.html.twig @@ -49,7 +49,13 @@ {% block paragraph %} {% block content %} - {{ content.field_name }} + {% set eventLink = content.field_link.0 %} + + {% if eventLink %} + {{ link(content.field_name, eventLink['#url_title'], { class: 'inline-block' }) }} + {% else %} + {{ content.field_name }} + {% endif %} {% if content.field_location.0 is not empty %} {{ 'in'|t }}