vitec_card: flipcard layout + card-back fields; shared-column repair

- layout_variant gains the value "flipcard" (onChange: reload)
- "Card Back" palette in the Layout tab directly below layout_variant:
  back_headline (Text, max 100) and back_text (Textarea, richtext),
  displayCond-gated on the flipcard layout; serialised unconditionally -
  the frontend keys the back face on layout_variant, not on field
  presence (spec 7.7)
- backend preview: flipcard badge + back-headline line
- repair "[ Missing label ]" in the card selects: layout_variant /
  background_variant are columns SHARED with vitec_ctabanner, and the
  index-wise Content Blocks merge dropped four card-only values from
  the base item list. Overrides/tt_content.php now pins the base column
  to the cta-banner lists and hands vitec_card its full lists via
  columnsOverrides (respected by FormEngine and DataHandler; an items
  override can only extend, never shorten - array_replace_recursive)
- spec v1.19 incl. head-matter fix (version table was stuck at 1.17)

Server follow-up: database:updateschema "*.add,*.change" + cache:flush

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
orascheandClaude Fable 5 committed 2026-09-25 12:16:16 +02:00
1 parent 43519505bc
commit 6db2234851
5 files changed
+123 -3

No files matched your search

@@ -212,4 +212,57 @@ use TYPO3\CMS\Extbase\Utility\ExtensionUtility;
}
}
unset($typeConfig);
// Shared Content-Block select columns (fix 2026-09-25).
//
// `layout_variant` and `background_variant` are defined by BOTH vitec/card
// and vitec/cta-banner - same identifier under the vendor prefix, so both
// blocks write the same tt_content columns. Content Blocks merges such
// diverging item lists INDEX-wise into the base column and generates no
// per-type items override: the card-only values `vertical`, `horizontal`,
// `horizontal_reverse` and background `none` did not exist as items at
// all, and FormEngine showed "[ Missing label ]" for exactly those stored
// values (hero-section / intro-paragraph dodged the trap long ago with
// `hero_` / `intro_` prefixes).
//
// Fixed here WITHOUT renaming columns (existing data and the JSON keys
// `layout_variant` / `background_variant` stay): the base column carries
// the short cta-banner lists, vitec_card gets its full lists through
// columnsOverrides. FormEngine and the DataHandler both respect
// columnsOverrides; the per-type merge is array_replace_recursive, so an
// items override can only EXTEND the base list, never shorten it - which
// holds (9/7 items over 3/5). New blocks must not reuse these identifiers
// with diverging items; prefix them instead.
$GLOBALS['TCA']['tt_content']['columns']['vitec_layout_variant']['config']['items'] = [
['label' => 'Centered (text over background)', 'value' => 'centered'],
['label' => 'Split (text left, CTAs right)', 'value' => 'split'],
['label' => 'Stacked (text top, CTAs below)', 'value' => 'stacked'],
];
$GLOBALS['TCA']['tt_content']['columns']['vitec_background_variant']['config']['items'] = [
['label' => 'Orange', 'value' => 'orange'],
['label' => 'Blue', 'value' => 'blue'],
['label' => 'Graphite', 'value' => 'graphite'],
['label' => 'Midnight', 'value' => 'midnight'],
['label' => 'Light (neutral)', 'value' => 'light'],
];
$GLOBALS['TCA']['tt_content']['types']['vitec_card']['columnsOverrides']['vitec_layout_variant']['config']['items'] = [
['label' => 'Vertical (image top, content below)', 'value' => 'vertical'],
['label' => 'Horizontal (image left, content right)', 'value' => 'horizontal'],
['label' => 'Horizontal Reverse (content left, image right)', 'value' => 'horizontal_reverse'],
['label' => 'Image Overlay (text over image)', 'value' => 'image_overlay'],
['label' => 'Text Only (no image)', 'value' => 'text_only'],
['label' => 'Icon Card (icon focused, text below)', 'value' => 'icon_card'],
['label' => 'Feature (large highlighted card)', 'value' => 'feature'],
['label' => 'Compact (small card, tight spacing)', 'value' => 'compact'],
['label' => 'Flip Card (front / back)', 'value' => 'flipcard'],
];
$GLOBALS['TCA']['tt_content']['types']['vitec_card']['columnsOverrides']['vitec_background_variant']['config']['items'] = [
['label' => 'None', 'value' => 'none'],
['label' => 'Orange', 'value' => 'orange'],
['label' => 'Blue', 'value' => 'blue'],
['label' => 'Graphite', 'value' => 'graphite'],
['label' => 'Midnight', 'value' => 'midnight'],
['label' => 'Light (neutral)', 'value' => 'light'],
['label' => 'Dark (neutral)', 'value' => 'dark'],
];
})();