Skip to content

Commit

Permalink
Merge pull request #1132 from City-of-Helsinki/UHF-10773
Browse files Browse the repository at this point in the history
UHF-10773: Make the popular services templates reusable
  • Loading branch information
jeremysteerio authored Dec 17, 2024
2 parents e519e1b + a37e42d commit d382573
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% if items is not empty %}
<ul class="popular-service-item__links">
{% for item in items %}
<li class="popular-service-item__link-wrapper">{{ item.content }}</li>
{% endfor %}
</ul>
{% embed "@hdbt/misc/popular-service-links.twig" with { items: items } %}
{% block link %}
{{ item.content }}
{% endblock %}
{% endembed %}
{% endif %}
6 changes: 6 additions & 0 deletions templates/misc/popular-service-item.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<div class="popular-service-item">
<h3 class="popular-service-item__title">{{ title }}</h3>
{% block links %}
{{ content }}
{% endblock %}
</div>
11 changes: 11 additions & 0 deletions templates/misc/popular-service-links.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{% if items is not empty %}
<ul class="popular-service-item__links">
{% for item in items %}
<li class="popular-service-item__link-wrapper">
{% block link %}
{{ link }}
{% endblock %}
</li>
{% endfor %}
</ul>
{% endif %}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<div class="popular-service-item">
<h3 class="popular-service-item__title">{{ content.field_service_title }}</h3>
{{ content.field_service_links }}
</div>
{% embed "@hdbt/misc/popular-service-item.twig" with { title: content.field_service_title } %}
{% block links %}
{{ content.field_service_links }}
{% endblock links %}
{% endembed %}

0 comments on commit d382573

Please sign in to comment.