program hide previous events section if empty

This commit is contained in:
isUnknown 2024-09-19 12:29:48 +02:00
parent c2701546aa
commit 068492e495

View file

@ -71,10 +71,12 @@
<h2>Prochainement <?= $page->children()->first()->title() ?></h2>
</section>
<?php snippet('events-grid', ['events' => $futureEvents, 'columns' => 3]) ?>
<section class="yellow">
<h2>Événements passés</h2>
</section>
<?php snippet('events-grid', ['events' => $pastEvents, 'columns' => 3]) ?>
<?php if ($pastEvents->count() > 0): ?>
<section class="yellow">
<h2>Événements passés</h2>
</section>
<?php snippet('events-grid', ['events' => $pastEvents, 'columns' => 3]) ?>
<?php endif ?>
</div>
</template>