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
|
- width: 2/3
|
||||||
sections:
|
sections:
|
||||||
investigations: fields/investigations
|
investigations: fields/investigations
|
||||||
highlightTab:
|
starredTab:
|
||||||
label: Mise en avant
|
label: En avant
|
||||||
icon: star
|
icon: star
|
||||||
fields:
|
fields:
|
||||||
pinnedInvestigations:
|
featuredInvestigation:
|
||||||
label: Enquêtes pinnées
|
label: À la une
|
||||||
type: pages
|
|
||||||
query: page('enquetes').children.listed
|
|
||||||
multiple: true
|
|
||||||
layout: list
|
|
||||||
text: "{{ page.title }}"
|
|
||||||
info: "{{ page.incidentDate }}"
|
|
||||||
superPinnedInvestigation:
|
|
||||||
label: Super pin (home)
|
|
||||||
type: pages
|
type: pages
|
||||||
query: page('enquetes').children.listed
|
query: page('enquetes').children.listed
|
||||||
multiple: false
|
multiple: false
|
||||||
|
|
@ -36,4 +28,16 @@ tabs:
|
||||||
layout: list
|
layout: list
|
||||||
text: "{{ page.title }}"
|
text: "{{ page.title }}"
|
||||||
info: "{{ page.incidentDate }}"
|
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
|
seo: seo/page
|
||||||
|
|
|
||||||
|
|
@ -45,16 +45,16 @@ $count = max(4, (int)$section->count()->value());
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$enquetesPage = page('enquetes');
|
$enquetesPage = page('enquetes');
|
||||||
$superPin = $enquetesPage->superPinnedInvestigation()->toPage();
|
$featured = $enquetesPage->featuredInvestigation()->toPage();
|
||||||
$pinned = $enquetesPage->pinnedInvestigations()->toPages();
|
$pinned = $enquetesPage->pinnedInvestigations()->toPages();
|
||||||
if ($superPin) $pinned = $pinned->not($superPin);
|
if ($featured) $pinned = $pinned->not($featured);
|
||||||
|
|
||||||
$list = [];
|
$list = [];
|
||||||
$shownIds = [];
|
$shownIds = [];
|
||||||
|
|
||||||
if ($superPin) {
|
if ($featured) {
|
||||||
$list[] = ['page' => $superPin, 'type' => 'super'];
|
$list[] = ['page' => $featured, 'type' => 'super'];
|
||||||
$shownIds[] = $superPin->id();
|
$shownIds[] = $featured->id();
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($pinned as $p) {
|
foreach ($pinned as $p) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue