From bf3e1e4a1be964caa6c9b27d9128ec2f76a7aac2 Mon Sep 17 00:00:00 2001 From: Tero Elonen Date: Tue, 10 Dec 2024 12:57:05 +0200 Subject: [PATCH] UHF-10773: Make the popular services templates reusable for Helsinki near you page purposes --- ...ield-service-links--popular-service-item.html.twig | 10 +++++----- templates/misc/popular-service-item.twig | 6 ++++++ templates/misc/popular-service-links.twig | 11 +++++++++++ .../paragraph--popular-service-item.html.twig | 9 +++++---- 4 files changed, 27 insertions(+), 9 deletions(-) create mode 100644 templates/misc/popular-service-item.twig create mode 100644 templates/misc/popular-service-links.twig diff --git a/templates/field/field--paragraph--field-service-links--popular-service-item.html.twig b/templates/field/field--paragraph--field-service-links--popular-service-item.html.twig index 673e76b1b..f4aad0dfe 100644 --- a/templates/field/field--paragraph--field-service-links--popular-service-item.html.twig +++ b/templates/field/field--paragraph--field-service-links--popular-service-item.html.twig @@ -1,7 +1,7 @@ {% if items is not empty %} - + {% embed "@hdbt/misc/popular-service-links.twig" with { items: items } %} + {% block link %} + {{ item.content }} + {% endblock %} + {% endembed %} {% endif %} diff --git a/templates/misc/popular-service-item.twig b/templates/misc/popular-service-item.twig new file mode 100644 index 000000000..e085330c7 --- /dev/null +++ b/templates/misc/popular-service-item.twig @@ -0,0 +1,6 @@ + diff --git a/templates/misc/popular-service-links.twig b/templates/misc/popular-service-links.twig new file mode 100644 index 000000000..2dbbd549f --- /dev/null +++ b/templates/misc/popular-service-links.twig @@ -0,0 +1,11 @@ +{% if items is not empty %} + +{% endif %} diff --git a/templates/paragraphs/paragraph--popular-service-item.html.twig b/templates/paragraphs/paragraph--popular-service-item.html.twig index f2eab0dce..57c8f5706 100644 --- a/templates/paragraphs/paragraph--popular-service-item.html.twig +++ b/templates/paragraphs/paragraph--popular-service-item.html.twig @@ -1,4 +1,5 @@ - +{% embed "@hdbt/misc/popular-service-item.twig" with { title: content.field_service_title } %} + {% block links %} + {{ content.field_service_links }} + {% endblock links %} +{% endembed %}