hic-et-nunc/site/plugins/file-methods/index.php
Camilledenoray 3486ae9c6c
All checks were successful
Deploy / Deploy to Production (push) Successful in 8s
Home > slideshow > videos verticales incluses dans paires
2026-07-07 20:19:57 +02:00

20 lines
628 B
PHP

<?php
Kirby::plugin('studio-variable/file-methods', [
'fileMethods' => [
// Orientation utilisable aussi pour les vidéos.
// Kirby ne sait pas lire les dimensions d'une vidéo nativement,
// on se base donc sur le toggle « isPortrait » du panel pour celles-ci.
'fileOrientation' => function () {
if ($this->type() === 'video') {
return $this->isPortrait()->isTrue() ? 'portrait' : 'landscape';
}
if ($this->type() === 'image') {
return $this->orientation();
}
return false;
}
]
]);