fix: correct field name mismatches in ImageTextBlock and QuoteBlock

ImageTextBlock: read CTA from cta group (cta.text/cta.link) instead of
flat ctaLabel/ctaLink fields.

QuoteBlock: read image from "image" field (not "backgroundImage"),
support CMS style values (simple/highlighted/with-image) instead of
the non-existent "parallax" value.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
CCS Admin 2026-02-25 17:02:51 +00:00
parent d236d0e9f1
commit 6e7292aaf5
2 changed files with 60 additions and 33 deletions

View file

@ -17,8 +17,9 @@ export function ImageTextBlock({ block }: ImageTextBlockProps) {
const imageUrl = (media?.url as string) || '' const imageUrl = (media?.url as string) || ''
const imageAlt = (media?.alt as string) || title const imageAlt = (media?.alt as string) || title
const imagePosition = (block.imagePosition as string) || 'left' const imagePosition = (block.imagePosition as string) || 'left'
const ctaLabel = (block.ctaLabel as string) || (block.buttonText as string) || '' const cta = block.cta as Record<string, unknown> | undefined
const ctaLink = (block.ctaLink as string) || (block.buttonLink as string) || '' const ctaLabel = (cta?.text as string) || (block.ctaLabel as string) || ''
const ctaLink = (cta?.link as string) || (block.ctaLink as string) || ''
const backgroundColor = (block.backgroundColor as string) || 'light' const backgroundColor = (block.backgroundColor as string) || 'light'
const isImageLeft = imagePosition === 'left' const isImageLeft = imagePosition === 'left'

View file

@ -1,6 +1,7 @@
'use client' 'use client'
import { motion } from 'framer-motion' import { motion } from 'framer-motion'
import Image from 'next/image'
interface QuoteBlockProps { interface QuoteBlockProps {
block: Record<string, unknown> block: Record<string, unknown>
@ -10,14 +11,25 @@ export function QuoteBlock({ block }: QuoteBlockProps) {
const quote = (block.quote as string) || (block.text as string) || '' const quote = (block.quote as string) || (block.text as string) || ''
const author = (block.author as string) || (block.attribution as string) || '' const author = (block.author as string) || (block.attribution as string) || ''
const role = (block.role as string) || '' const role = (block.role as string) || ''
const backgroundMedia = block.backgroundImage as Record<string, unknown> | undefined const media = block.image as Record<string, unknown> | undefined
const backgroundUrl = backgroundMedia?.url as string | undefined const imageUrl = (media?.url as string) || ''
const style = (block.style as string) || (backgroundUrl ? 'parallax' : 'simple') const imageAlt = (media?.alt as string) || author
const style = (block.style as string) || 'simple'
if (style === 'simple') { // Style "with-image": Autor mit Bild
if (style === 'with-image' && imageUrl) {
return ( return (
<section className="py-ws-m bg-light-bg"> <section className="py-ws-m bg-light-bg">
<div className="max-w-3xl mx-auto px-4 text-center"> <div className="max-w-3xl mx-auto px-4 text-center">
<div className="mb-6">
<Image
src={imageUrl}
alt={imageAlt}
width={80}
height={80}
className="rounded-full mx-auto object-cover"
/>
</div>
<blockquote className="text-[1.4em] leading-[1.6em] text-gray italic mb-8"> <blockquote className="text-[1.4em] leading-[1.6em] text-gray italic mb-8">
&ldquo;{quote}&rdquo; &ldquo;{quote}&rdquo;
</blockquote> </blockquote>
@ -36,18 +48,10 @@ export function QuoteBlock({ block }: QuoteBlockProps) {
) )
} }
// Style "highlighted": Hervorgehobenes Zitat mit dunklem Hintergrund
if (style === 'highlighted') {
return ( return (
<section <section className="relative bg-dark">
className="relative bg-cover bg-center bg-fixed"
style={{
backgroundImage: backgroundUrl ? `url(${backgroundUrl})` : undefined,
backgroundColor: !backgroundUrl ? '#111' : undefined,
}}
>
{/* Overlay */}
<div className="absolute inset-0 bg-dark/50" />
{/* Content */}
<motion.div <motion.div
className="relative py-ws-m w-[90%] md:w-[55%] mx-auto text-center" className="relative py-ws-m w-[90%] md:w-[55%] mx-auto text-center"
initial={{ opacity: 0, y: 30 }} initial={{ opacity: 0, y: 30 }}
@ -78,3 +82,25 @@ export function QuoteBlock({ block }: QuoteBlockProps) {
</section> </section>
) )
} }
// Default: Style "simple"
return (
<section className="py-ws-m bg-light-bg">
<div className="max-w-3xl mx-auto px-4 text-center">
<blockquote className="text-[1.4em] leading-[1.6em] text-gray italic mb-8">
&ldquo;{quote}&rdquo;
</blockquote>
<footer>
<cite className="font-heading text-[1em] tracking-[2px] uppercase text-dark not-italic block mb-2">
{author}
</cite>
{role && (
<span className="font-heading text-[0.85em] tracking-[2px] uppercase text-gray-light">
{role}
</span>
)}
</footer>
</div>
</section>
)
}