Removed deprecated manual merges of default site controller data with specific controller data

This commit is contained in:
Paul Nicoué 2025-07-11 14:55:58 +02:00
parent 0fefc5e2e1
commit 7bc8cd51c0
3 changed files with 11 additions and 23 deletions

View file

@ -1,9 +1,6 @@
<?php
return function ($kirby, $site) {
// Get shared data from default controller (site.php)
$shared = $kirby->controller('site' , compact('site'));
return function ($site) {
// Get CV page URL and override logo href and aria-label attributes
$logoHref = page('cv')->url();
@ -12,13 +9,10 @@ return function ($kirby, $site) {
// Get items from image gallery structure field
$galleryItems = $site->image_gallery()->toStructure();
// Return merged arrays containing shared data and current controller data
return A::merge(
$shared,
compact(
'galleryItems',
'logoAriaLabel',
'logoHref',
)
// Return home controller data
return compact(
'galleryItems',
'logoAriaLabel',
'logoHref',
);
};