geoproject-app/public/site/plugins/cover-files/index.php
2026-02-26 11:30:32 +01:00

19 lines
535 B
PHP

<?php
Kirby::plugin('geoproject/cover-files', [
'pageMethods' => [
'coverFiles' => function () {
return $this->files()->add(
$this->children()->filterBy('intendedTemplate', 'map')->files()
);
}
],
'fileMethods' => [
'coverLabel' => function () {
if ($this->parent()->intendedTemplate()->name() === 'map') {
return 'Carte "' . $this->parent()->title() . '"';
}
return $this->filename();
}
]
]);