From d236d0e9f12dea71da573fa5942c6d4ca060d4f2 Mon Sep 17 00:00:00 2001 From: CCS Admin Date: Wed, 25 Feb 2026 16:51:35 +0000 Subject: [PATCH] fix: read card link/linkText as flat fields instead of nested object The CMS card-grid-block defines link (URL) and linkText (label) as separate text fields, but the component treated link as a group object with href/label sub-fields. Also prioritize headline over title to match the CMS field name. Co-Authored-By: Claude Opus 4.6 --- src/components/blocks/CardGridBlock.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/blocks/CardGridBlock.tsx b/src/components/blocks/CardGridBlock.tsx index a6ba31d..c6cf7ce 100644 --- a/src/components/blocks/CardGridBlock.tsx +++ b/src/components/blocks/CardGridBlock.tsx @@ -13,7 +13,7 @@ interface CardGridBlockProps { } export function CardGridBlock({ block }: CardGridBlockProps) { - const title = (block.title as string) || (block.headline as string) || '' + const title = (block.headline as string) || (block.title as string) || '' const subtitle = (block.subtitle as string) || '' const cards = (block.cards as Array>) || [] const columns = (block.columns as number) || 3 @@ -46,9 +46,8 @@ export function CardGridBlock({ block }: CardGridBlockProps) { const iconPosition = (card.iconPosition as string) || 'top' const cardImage = card.image as Record | undefined const cardImageUrl = cardImage?.url as string | undefined - const cardLink = card.link as Record | undefined - const cardLinkLabel = (cardLink?.label as string) || 'Mehr erfahren' - const cardLinkHref = (cardLink?.href as string) || (cardLink?.url as string) || '' + const cardLinkHref = (card.link as string) || '' + const cardLinkLabel = (card.linkText as string) || 'Mehr erfahren' const isIconLeft = mediaType === 'icon' && iconPosition === 'left'