From 6eba8122ea8c1ede5ff9b63bd12a5643900c9df0 Mon Sep 17 00:00:00 2001 From: isUnknown Date: Thu, 31 Oct 2024 16:33:38 +0100 Subject: [PATCH] home > events : add custom events field (from 0 to 3 events) #7 --- site/blueprints/site.yml | 12 ++++++++++++ site/templates/home.php | 9 +-------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/site/blueprints/site.yml b/site/blueprints/site.yml index 547e844..46dbd27 100644 --- a/site/blueprints/site.yml +++ b/site/blueprints/site.yml @@ -91,10 +91,22 @@ tabs: cover: true when: heroMode: custom + - width: 1/1 fields: line: type: line + events: + label: Événement + type: pages + layout: cards + size: huge + query: page('programme').grandChildren + max: 3 + image: + cover: true + otherLine: + type: line - width: 1/1 fields: callout: fields/callout diff --git a/site/templates/home.php b/site/templates/home.php index b27f576..0b37595 100644 --- a/site/templates/home.php +++ b/site/templates/home.php @@ -50,18 +50,11 @@ collection('ordered-season'); - $comingEvents = filterFutureEvents($orderedSeason); -?> - - 'Prochainement', 'events' => $comingEvents->slice(0, 2), 'columns' => 2]) + snippet('events-grid', ['title' => 'Prochainement', 'events' => $site->events()->toPages(), 'columns' => $site->events()->toPages()->count() === 1 ? 2 : $site->events()->toPages()->count()]) ?> - $comingEvents->slice(2, 3)]) ?> - \ No newline at end of file