Skip to content

Commit af8c39a

Browse files
committed
Conditional rendering of recent posts section
1 parent 01a2cf0 commit af8c39a

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/App/templates/app/index.html.twig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,12 +643,13 @@
643643
</div>
644644
</section>
645645

646+
{% if posts is defined and posts is iterable %}
646647
<section class="py-5">
647648
<div class="container">
648649
<h4 class="text-center py-2">Blog</h4>
649650
<h2 class="mb-4 text-center pb-2">Useful Reads</h2>
650651
<div class="row g-4">
651-
{% for post in posts %}
652+
{% for post in posts %}
652653
<div class="col-md-4">
653654
<div class="card h-100 border-0 shadow-sm rounded-3">
654655
<div class="card-body d-flex flex-column p-4">
@@ -678,6 +679,7 @@
678679
</div>
679680
</div>
680681
</section>
682+
{% endif %}
681683

682684
<section class="py-5">
683685
<div class="container">

0 commit comments

Comments
 (0)