From 9aa2041ec49b5ff27a6440a2b4131cd2db291f90 Mon Sep 17 00:00:00 2001 From: isUnknown Date: Fri, 27 Feb 2026 11:25:14 +0100 Subject: [PATCH] refactor: rename investigation highlight fields MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Rename `superPinnedInvestigation` → `featuredInvestigation` (à la une, max 1) - Rename `pinnedInvestigations` → stays `pinnedInvestigations` but now multiple - Rename tab `highlightTab` → `starredTab` - Update home.php to use new field names Co-Authored-By: Claude Sonnet 4.6 --- site/blueprints/pages/investigations.yml | 28 ++++++++++++++---------- site/templates/home.php | 10 ++++----- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/site/blueprints/pages/investigations.yml b/site/blueprints/pages/investigations.yml index 0ee8ce8..7b15b5a 100644 --- a/site/blueprints/pages/investigations.yml +++ b/site/blueprints/pages/investigations.yml @@ -15,20 +15,12 @@ tabs: - width: 2/3 sections: investigations: fields/investigations - highlightTab: - label: Mise en avant + starredTab: + label: En avant icon: star fields: - pinnedInvestigations: - label: Enquêtes pinnées - type: pages - query: page('enquetes').children.listed - multiple: true - layout: list - text: "{{ page.title }}" - info: "{{ page.incidentDate }}" - superPinnedInvestigation: - label: Super pin (home) + featuredInvestigation: + label: À la une type: pages query: page('enquetes').children.listed multiple: false @@ -36,4 +28,16 @@ tabs: layout: list text: "{{ page.title }}" info: "{{ page.incidentDate }}" + width: 1/3 + help: Affichée en tête et en plus grand, avec son média de couverture (vidéo ou image). + pinnedInvestigations: + label: Enquêtes épinglées + type: pages + query: page('enquetes').children.listed + multiple: true + layout: list + text: "{{ page.title }}" + info: "{{ page.incidentDate }}" + width: 2/3 + help: Affichées après l'enquête "à la une", avant les autres mais dans le même format, simplement marquées par une 📌. seo: seo/page diff --git a/site/templates/home.php b/site/templates/home.php index 3a4490b..08ba960 100644 --- a/site/templates/home.php +++ b/site/templates/home.php @@ -45,16 +45,16 @@ $count = max(4, (int)$section->count()->value()); superPinnedInvestigation()->toPage(); + $featured = $enquetesPage->featuredInvestigation()->toPage(); $pinned = $enquetesPage->pinnedInvestigations()->toPages(); - if ($superPin) $pinned = $pinned->not($superPin); + if ($featured) $pinned = $pinned->not($featured); $list = []; $shownIds = []; - if ($superPin) { - $list[] = ['page' => $superPin, 'type' => 'super']; - $shownIds[] = $superPin->id(); + if ($featured) { + $list[] = ['page' => $featured, 'type' => 'super']; + $shownIds[] = $featured->id(); } foreach ($pinned as $p) {