refactor: rename investigation highlight fields
- 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 <noreply@anthropic.com>
This commit is contained in:
parent
4e45d5a5dc
commit
9aa2041ec4
2 changed files with 21 additions and 17 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -45,16 +45,16 @@ $count = max(4, (int)$section->count()->value());
|
|||
|
||||
<?php
|
||||
$enquetesPage = page('enquetes');
|
||||
$superPin = $enquetesPage->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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue