Wähle eine Stelle auch aus der Website-Datei eines Films ohne Fassung als Kartenbild
Der Regler „Bild aus dem Film“ der Medienkarte blieb bei einem Film nur mit Website-Datei (zum Beispiel ein Teaser) aus, weil er eine bereitgestellte Fassung verlangte. Die Stelle kommt jetzt aus der Website-Datei (Herkunft frame:0@Sekunde, wie im Medienmanager), mit Vorschau über die Redaktionsroute und Übernahme als Bild-Medium in bis zu 1600 px Breite. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
631502c064
commit
1413e0640f
6 files changed
+247
-18
No files matched your search
@@ -107,20 +107,31 @@ protected function imageSourceFields(): array
|
||||
->view('filament.cms.filmbild-feld')
|
||||
->dehydrated(false)
|
||||
->visible(fn (Get $get): bool => $this->filmFor($get('element')) !== null)
|
||||
->viewData(function (Get $get): array {
|
||||
$film = $this->filmFor($get('element'));
|
||||
$stills = app(FilmStill::class);
|
||||
$version = $film instanceof ContentElement ? $stills->version($film) : null;
|
||||
->viewData(fn (Get $get): array => $this->filmFieldData($this->filmFor($get('element')))),
|
||||
];
|
||||
}
|
||||
|
||||
return [
|
||||
'film' => $film,
|
||||
'filmTitle' => $film instanceof ContentElement ? (string) ($film->display_title ?: $film->working_title) : '',
|
||||
'filmVersionId' => $version?->id,
|
||||
'filmHasThumbnail' => $film instanceof ContentElement && is_string($film->thumbnail_path) && $film->thumbnail_path !== '',
|
||||
'filmThumbnailUrl' => $film instanceof ContentElement ? ThumbnailRef::url('editorial.card', 'element', (int) $film->id, $film->thumbnail_path) : null,
|
||||
'filmStartSecond' => $film instanceof ContentElement ? ($stills->thumbnailSecond($film) ?? '0') : '0',
|
||||
];
|
||||
}),
|
||||
/**
|
||||
* Anzeigedaten des Felds „Bild aus dem Film“. Die Stelle kommt aus der bereitgestellten Fassung, bei einem Film
|
||||
* nur mit Website-Datei aus dieser (Route content.website-frame).
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
protected function filmFieldData(?ContentElement $film): array
|
||||
{
|
||||
$stills = app(FilmStill::class);
|
||||
$version = $film instanceof ContentElement ? $stills->version($film) : null;
|
||||
|
||||
return [
|
||||
'film' => $film,
|
||||
'filmTitle' => $film instanceof ContentElement ? (string) ($film->display_title ?: $film->working_title) : '',
|
||||
'filmVersionId' => $version?->id,
|
||||
'filmWebsiteFrameUrl' => $film instanceof ContentElement && $version === null && $stills->websiteFile($film) !== null
|
||||
? route('content.website-frame', ['element' => $film])
|
||||
: null,
|
||||
'filmHasThumbnail' => $film instanceof ContentElement && is_string($film->thumbnail_path) && $film->thumbnail_path !== '',
|
||||
'filmThumbnailUrl' => $film instanceof ContentElement ? ThumbnailRef::url('editorial.card', 'element', (int) $film->id, $film->thumbnail_path) : null,
|
||||
'filmStartSecond' => $film instanceof ContentElement ? ($stills->thumbnailSecond($film) ?? '0') : '0',
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user