Richte Karten im Abschnitt an der größten Karte aus und setze Kartenlinks an den unteren Rand
CI Feature / test (push) Successful in 8m2s
Deploy Test / test (push) Successful in 8m1s
Deploy Test / deploy (push) Successful in 51s

Zwei Gestaltungswerte am Abschnitt (Höhe der Karten, Link in der Karte), gespeichert nur bei Abweichung
von der Vorgabe. Karten nebeneinander füllen die Zeilenhöhe (CSS); ein kleines Skript gleicht Zeilen
untereinander an. Links im Fließtext bleiben unberührt (ADR-66).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
LarsandClaude Sonnet 5.5 committed 2026-11-29 17:33:27 +01:00
1 parent 33310463fd
commit 62f3a33541
16 files changed
+475 -2

No files matched your search

+7
View File
@@ -462,6 +462,13 @@ private function normalizeStyle(array $style, string $prefix, array &$errors): a
$result[$key] = $value;
}
// Ergänzende Optionen stehen nur bei Abweichung von der Vorgabe im gespeicherten Stand.
foreach (SectionStyle::OPTIONAL as $key => $default) {
if (($result[$key] ?? $default) === $default) {
unset($result[$key]);
}
}
if ($result['background'] === 'image') {
$widgetErrors = new WidgetErrors;
$refs = ImageRefFields::clean(['image' => $style['image'] ?? null, '_upload' => $style['_upload'] ?? null], $widgetErrors, errorKey: 'image');
@@ -132,6 +132,15 @@ private function renderSection(array $section, array $cells, int $index, RenderC
$classes[] = 'section-overlay-'.$style['overlay'];
}
// Karten im Abschnitt (ADR-66): nur bei Abweichung von der Vorgabe, damit die Ausgabe bestehender Seiten gleich bleibt.
if ($style['cards_height'] === 'equal') {
$classes[] = 'section-cards-equal';
}
if ($style['cards_links'] === 'bottom') {
$classes[] = 'section-cards-links-bottom';
}
// Bedeutungswerte der Fläche (tokens.css): helle Schrift auf dunklen Flächen, gelber Fokus.
$scope = match (true) {
$hasImage && $style['overlay'] === 'dark' => 'scope-dark',
+42 -2
View File
@@ -85,6 +85,27 @@ final class SectionStyle
'bottom_right' => '100% 100%',
];
/**
* Karten im Abschnitt (ADR-66): Höhe aller Karten des Abschnitts. „Gleich hoch“ richtet alle Karten an der größten aus.
*
* @var array<string, string>
*/
public const CARD_HEIGHTS = [
'auto' => 'Nach Inhalt der Karte',
'equal' => 'Alle so hoch wie die größte Karte',
];
/**
* Karten im Abschnitt (ADR-66): Lage des Links in Karten mit eigenem Link (Schaltfläche, „Mehr erfahren“). Links im
* Fließtext einer Karte bleiben, wo sie stehen.
*
* @var array<string, string>
*/
public const CARD_LINKS = [
'text' => 'Direkt unter dem Text',
'bottom' => 'Am unteren Rand der Karte',
];
public const DEFAULTS = [
'background' => 'default',
'image' => null,
@@ -97,6 +118,15 @@ final class SectionStyle
'divider' => 'none',
];
/**
* Ergänzende Gestaltungsoptionen: Sie stehen nur im gespeicherten Stand, wenn sie von der Vorgabe abweichen, damit
* Abschnitte ohne diese Optionen unverändert bleiben (Format und Vergleich mit dem letzten Stand).
*/
public const OPTIONAL = [
'cards_height' => 'auto',
'cards_links' => 'text',
];
/**
* Aufzählungsfelder und ihre zulässigen Werte.
*
@@ -113,6 +143,8 @@ public static function enums(): array
'spacing_bottom' => self::SPACINGS,
'gap' => self::SPACINGS,
'divider' => self::DIVIDERS,
'cards_height' => self::CARD_HEIGHTS,
'cards_links' => self::CARD_LINKS,
];
}
@@ -120,12 +152,12 @@ public static function enums(): array
* Lesepfad: gespeicherte Werte; Unbekanntes fällt auf die Vorgabe zurück, damit alte oder fremde Daten
* nie eine Seite brechen.
*
* @return array{background: string, image: ?string, focus: string, overlay: string, width: string, spacing_top: string, spacing_bottom: string, gap: string, divider: string}
* @return array{background: string, image: ?string, focus: string, overlay: string, width: string, spacing_top: string, spacing_bottom: string, gap: string, divider: string, cards_height: string, cards_links: string}
*/
public static function fromStored(mixed $style): array
{
$style = is_array($style) ? $style : [];
$result = self::DEFAULTS;
$result = self::DEFAULTS + self::OPTIONAL;
foreach (self::enums() as $key => $options) {
$value = $style[$key] ?? null;
@@ -166,6 +198,14 @@ public static function summary(array $style): string
$parts[] = 'Trenner: '.self::DIVIDERS[$style['divider']];
}
if ($style['cards_height'] === 'equal') {
$parts[] = 'Karten gleich hoch';
}
if ($style['cards_links'] === 'bottom') {
$parts[] = 'Kartenlinks unten';
}
return implode(' · ', $parts);
}