Saisonfotos am Foto statt am Erscheinungsbild
Ein Foto gehoert zu keinem (ganzjaehrig) oder mehreren Erscheinungsbildern und erscheint nur dort, vor den ganzjaehrigen Fotos. Bausteine waehlen "automatisch" oder eine eigene Auswahl; Titelbereich und Abschluss zeigen das erste passende Foto ihrer Liste. Titelbild und "Bilder je Baustein" des Erscheinungsbilds werden in die Bausteine uebernommen und entfallen dort. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d02f3e05c7
commit
791786ed3e
21 files changed
+449
-235
No files matched your search
@@ -33,25 +33,21 @@ public static function schema(): array
|
||||
TextInput::make('eyebrow')->label('Kleine Überschrift')->maxLength(100),
|
||||
TextInput::make('heading')->label('Überschrift')->required()->maxLength(160),
|
||||
RichEditor::make('text')->label('Text')->toolbarButtons([['bold', 'italic', 'link'], ['bulletList', 'orderedList']]),
|
||||
static::photoSelect('photo_ids', 'Bilder (bis zu 3)', multiple: true)->maxItems(3),
|
||||
static::photoSelect('photo_ids', 'Bilder', multiple: true)->maxItems(9)
|
||||
->helperText('Gezeigt werden die ersten drei, die zum Erscheinungsbild passen. '.self::SEASON_HINT),
|
||||
Select::make('image_position')->label('Bilder')->options(['right' => 'rechts', 'left' => 'links'])->default('right'),
|
||||
TextInput::make('link_label')->label('Link-Text')->maxLength(80),
|
||||
static::pageSelect('link_page', 'Link zur Seite'),
|
||||
];
|
||||
}
|
||||
|
||||
public static function photoSlots(): array
|
||||
{
|
||||
return ['photo_ids' => ['label' => 'Bilder', 'type' => self::SLOT_MULTIPLE, 'max' => 3]];
|
||||
}
|
||||
|
||||
public function data(Theme $theme, array $data): array
|
||||
{
|
||||
return [
|
||||
'eyebrow' => $data['eyebrow'] ?? null,
|
||||
'heading' => $data['heading'] ?? '',
|
||||
'text' => $this->html($data['text'] ?? null),
|
||||
'photos' => $this->seasonalPhotos($theme, $data, 'photo_ids') ?? $this->photos($data['photo_ids'] ?? []),
|
||||
'photos' => $this->chosenPhotos($theme, $data['photo_ids'] ?? [])->take(3)->values(),
|
||||
'imagePosition' => $data['image_position'] ?? 'right',
|
||||
'linkLabel' => $data['link_label'] ?? null,
|
||||
'linkUrl' => $this->pageUrl($data['link_page'] ?? null),
|
||||
|
||||
Reference in new issue
Block a user