Skip to content

Commit

Permalink
UHF-10773: Make the popular services templates reusable for Helsinki …
Browse files Browse the repository at this point in the history
…near you page purposes
  • Loading branch information
teroelonen authored and jeremysteerio committed Dec 12, 2024
1 parent d35f85e commit a37e42d
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 a37e42d

Please sign in to comment.