From 0e5c9808a83d483b4c08afdff9b18341eeb54fd1 Mon Sep 17 00:00:00 2001
From: CCS Admin
Date: Sat, 21 Feb 2026 02:31:27 +0000
Subject: [PATCH] fix: replace hardcoded content with CMS data
- Phone number: 10 locations now use CMS site-settings contact.phone
- ContactForm: service dropdown options from CMS services
- FAQ categories: display names derived from CMS services
- Footer: Top Fachbereiche column dynamic from CMS services
- SEO metadata: fachbereiche, faq, kontakt use generateMetadata()
- HomeCTA: converted to async server component, fetches settings
- Added phoneToHref() helper to payload-helpers.ts
Co-Authored-By: Claude Opus 4.6
---
src/app/fachbereiche/[slug]/page.tsx | 18 +++---
src/app/fachbereiche/page.tsx | 23 +++++---
src/app/faq/page.tsx | 43 ++++++++------
src/app/kontakt/page.tsx | 26 ++++++---
src/app/layout.tsx | 13 ++++-
src/app/so-funktionierts/page.tsx | 11 +++-
src/app/ueber-uns/page.tsx | 13 +++--
src/components/contact/ContactForm.tsx | 26 ++++++---
src/components/home/HomeCTA.tsx | 9 ++-
src/components/layout/Footer.tsx | 77 +++++++++++++-------------
src/components/layout/Header.tsx | 12 +++-
src/components/layout/MobileMenu.tsx | 13 ++++-
src/lib/payload-helpers.ts | 8 +++
13 files changed, 190 insertions(+), 102 deletions(-)
diff --git a/src/app/fachbereiche/[slug]/page.tsx b/src/app/fachbereiche/[slug]/page.tsx
index 10f00e0..e4f3cec 100644
--- a/src/app/fachbereiche/[slug]/page.tsx
+++ b/src/app/fachbereiche/[slug]/page.tsx
@@ -4,7 +4,8 @@ import { Container } from "@/components/ui/Container"
import { Button } from "@/components/ui/Button"
import { RichTextRenderer } from "@/components/ui/RichTextRenderer"
import { getLucideIcon } from "@/lib/icon-map"
-import { getServices, getServiceBySlug } from "@/lib/api"
+import { getServices, getServiceBySlug, getSiteSettings } from "@/lib/api"
+import { phoneToHref } from "@/lib/payload-helpers"
import { Phone, Mail, ArrowRight, Check } from "lucide-react"
export async function generateStaticParams() {
@@ -32,14 +33,15 @@ export default async function ServiceDetailPage({
params: Promise<{ slug: string }>
}) {
const { slug } = await params
- const service = await getServiceBySlug(slug)
+ const [service, settings] = await Promise.all([
+ getServiceBySlug(slug),
+ getSiteSettings(),
+ ])
if (!service) notFound()
const Icon = getLucideIcon(service.icon)
const shortTitle = service.title.replace(/^Zweitmeinung\s+/, "")
- const categoryName = typeof service.category === "object" && service.category
- ? service.category.name
- : null
+ const phone = settings?.contact?.phone || "0800 80 44 100"
return (
<>
@@ -60,7 +62,7 @@ export default async function ServiceDetailPage({
{service.shortDescription}
-
diff --git a/src/app/layout.tsx b/src/app/layout.tsx
index 97f23ee..f21a287 100644
--- a/src/app/layout.tsx
+++ b/src/app/layout.tsx
@@ -1,6 +1,7 @@
import type { Metadata } from "next"
import { TopBar, Header, Footer, EmergencyBanner } from "@/components/layout"
import { getNavigation, getSiteSettings, getSocialLinks, getServices } from "@/lib/api"
+import { phoneToHref } from "@/lib/payload-helpers"
import "./globals.css"
export const metadata: Metadata = {
@@ -32,12 +33,20 @@ export default async function RootLayout({
getServices(),
])
+ const phone = settings?.contact?.phone || "0800 80 44 100"
+ const email = settings?.contact?.email || "kontakt@zweitmeinu.ng"
+
const headerServices = services.map((s) => ({
title: s.title,
slug: s.slug,
icon: s.icon ?? null,
}))
+ const footerServices = services.map((s) => ({
+ title: s.title.replace(/^Zweitmeinung\s+/, ""),
+ slug: s.slug,
+ }))
+
return (
@@ -49,12 +58,12 @@ export default async function RootLayout({
-
+
{children}
-
+
diff --git a/src/app/so-funktionierts/page.tsx b/src/app/so-funktionierts/page.tsx
index 8c92b1c..79a79b7 100644
--- a/src/app/so-funktionierts/page.tsx
+++ b/src/app/so-funktionierts/page.tsx
@@ -1,6 +1,8 @@
import type { Metadata } from "next"
import { Container } from "@/components/ui/Container"
import { Button } from "@/components/ui/Button"
+import { getSiteSettings } from "@/lib/api"
+import { phoneToHref } from "@/lib/payload-helpers"
import {
Phone, FileText, UserCheck, ClipboardCheck,
MessageSquare, HeartHandshake, Shield, Clock,
@@ -28,7 +30,10 @@ const whyCards = [
{ title: "Persönlich", description: "Case Management und persönliche Betreuung von Anfang an.", icon: Users },
]
-export default function SoFunktionierts() {
+export default async function SoFunktionierts() {
+ const settings = await getSiteSettings()
+ const phone = settings?.contact?.phone || "0800 80 44 100"
+
return (
<>
{/* Hero */}
@@ -104,9 +109,9 @@ export default function SoFunktionierts() {
fundierte, unabhängige Einschätzung.
-
+
- 0800 80 44 100
+ {phone}
Kontaktformular
diff --git a/src/app/ueber-uns/page.tsx b/src/app/ueber-uns/page.tsx
index 50fae75..1db5a24 100644
--- a/src/app/ueber-uns/page.tsx
+++ b/src/app/ueber-uns/page.tsx
@@ -1,6 +1,8 @@
import type { Metadata } from "next"
import { Container } from "@/components/ui/Container"
import { Button } from "@/components/ui/Button"
+import { getSiteSettings } from "@/lib/api"
+import { phoneToHref } from "@/lib/payload-helpers"
import {
Shield, Award, Users, Heart, Phone,
CheckCircle, Building, Globe,
@@ -18,7 +20,10 @@ const qualityCards = [
{ title: "Netzwerk", description: "Über 1000 Expert:innen aus über 50 Fachbereichen deutschlandweit.", icon: Globe },
]
-export default function UeberUnsPage() {
+export default async function UeberUnsPage() {
+ const settings = await getSiteSettings()
+ const phone = settings?.contact?.phone || "0800 80 44 100"
+
return (
<>
{/* Hero */}
@@ -99,7 +104,7 @@ export default function UeberUnsPage() {
- Kostenlose Servicehotline: 0800 80 44 100
+ Kostenlose Servicehotline: {phone}
@@ -117,9 +122,9 @@ export default function UeberUnsPage() {
Wir beraten Sie gerne unverbindlich und kostenfrei.
-
+
- 0800 80 44 100 (kostenlos)
+ {phone} (kostenlos)
diff --git a/src/components/contact/ContactForm.tsx b/src/components/contact/ContactForm.tsx
index aedcda4..856acde 100644
--- a/src/components/contact/ContactForm.tsx
+++ b/src/components/contact/ContactForm.tsx
@@ -5,7 +5,11 @@ import { Send, Loader2, CheckCircle } from "lucide-react"
const PAYLOAD_URL = process.env.NEXT_PUBLIC_PAYLOAD_URL || "https://cms.c2sgmbh.de"
-export function ContactForm() {
+interface ContactFormProps {
+ serviceOptions?: Array<{ value: string; label: string }>
+}
+
+export function ContactForm({ serviceOptions = [] }: ContactFormProps) {
const [form, setForm] = useState({
name: "",
email: "",
@@ -52,6 +56,17 @@ export function ContactForm() {
}
}
+ const options = serviceOptions.length > 0
+ ? serviceOptions
+ : [
+ { value: "intensivmedizin", label: "Intensivmedizin" },
+ { value: "kardiologie", label: "Kardiologie" },
+ { value: "onkologie", label: "Onkologie" },
+ { value: "nephrologie", label: "Nephrologie" },
+ { value: "gallenblase", label: "Gallenblase" },
+ { value: "schilddruese", label: "Schilddrüse" },
+ ]
+
if (status === "success") {
return (
@@ -129,12 +144,9 @@ export function ContactForm() {
className="w-full px-4 py-2.5 rounded-lg border border-border bg-bg focus:outline-none focus:ring-2 focus:ring-primary/30 focus:border-primary text-sm"
>
-
-
-
-
-
-
+ {options.map((opt) => (
+
+ ))}
diff --git a/src/components/home/HomeCTA.tsx b/src/components/home/HomeCTA.tsx
index 6c74d46..651655b 100644
--- a/src/components/home/HomeCTA.tsx
+++ b/src/components/home/HomeCTA.tsx
@@ -1,8 +1,13 @@
import { Phone, Mail } from "lucide-react"
import { Container } from "@/components/ui/Container"
import { Button } from "@/components/ui/Button"
+import { getSiteSettings } from "@/lib/api"
+import { phoneToHref } from "@/lib/payload-helpers"
+
+export async function HomeCTA() {
+ const settings = await getSiteSettings()
+ const phone = settings?.contact?.phone || "0800 80 44 100"
-export function HomeCTA() {
return (
@@ -15,7 +20,7 @@ export function HomeCTA() {
Sicherheit, die Sie verdienen.
-
+
Jetzt kostenlos beraten lassen
diff --git a/src/components/layout/Footer.tsx b/src/components/layout/Footer.tsx
index 358e3bc..624027c 100644
--- a/src/components/layout/Footer.tsx
+++ b/src/components/layout/Footer.tsx
@@ -6,51 +6,50 @@ import { socialLinksToMap } from "@/lib/payload-helpers"
interface FooterProps {
socialLinks?: SocialLink[]
settings?: SiteSetting | null
+ services?: Array<{ title: string; slug: string }>
}
-const footerColumns = [
- {
- title: "Top Fachbereiche",
- links: [
- { label: "Kardiologie", href: "/fachbereiche/zweitmeinung-kardiologie" },
- { label: "Onkologie", href: "/fachbereiche/zweitmeinung-onkologie" },
- { label: "Intensivmedizin", href: "/fachbereiche/zweitmeinung-intensivmedizin" },
- { label: "Nephrologie", href: "/fachbereiche/zweitmeinung-nephrologie" },
- { label: "Gallenblase", href: "/fachbereiche/zweitmeinung-gallenblase" },
- { label: "Schilddrüse", href: "/fachbereiche/zweitmeinung-schilddruese" },
- ],
- },
- {
- title: "Services",
- links: [
- { label: "So funktioniert's", href: "/so-funktionierts" },
- { label: "Häufige Fragen (FAQ)", href: "/faq" },
- { label: "Alle Fachbereiche", href: "/fachbereiche" },
- { label: "Kontakt", href: "/kontakt" },
- ],
- },
- {
- title: "Unternehmen",
- links: [
- { label: "Über uns", href: "/ueber-uns" },
- { label: "Motivation", href: "/motivation" },
- { label: "complex care solutions GmbH", href: "https://complexcaresolutions.de" },
- ],
- },
- {
- title: "Rechtliches",
- links: [
- { label: "Impressum", href: "/impressum" },
- { label: "Datenschutz", href: "/datenschutz" },
- ],
- },
-]
-
-export function Footer({ socialLinks, settings }: FooterProps) {
+export function Footer({ socialLinks, settings, services = [] }: FooterProps) {
const socialMap = socialLinksToMap(socialLinks)
const copyright = settings?.footer?.copyrightText ||
`\u00A9 ${new Date().getFullYear()} complex care solutions GmbH. Alle Rechte vorbehalten.`
+ const fachbereicheLinks = services.length > 0
+ ? services.map((s) => ({ label: s.title, href: `/fachbereiche/${s.slug}` }))
+ : [
+ { label: "Kardiologie", href: "/fachbereiche/zweitmeinung-kardiologie" },
+ { label: "Onkologie", href: "/fachbereiche/zweitmeinung-onkologie" },
+ { label: "Intensivmedizin", href: "/fachbereiche/zweitmeinung-intensivmedizin" },
+ ]
+
+ const footerColumns = [
+ { title: "Top Fachbereiche", links: fachbereicheLinks },
+ {
+ title: "Services",
+ links: [
+ { label: "So funktioniert's", href: "/so-funktionierts" },
+ { label: "Häufige Fragen (FAQ)", href: "/faq" },
+ { label: "Alle Fachbereiche", href: "/fachbereiche" },
+ { label: "Kontakt", href: "/kontakt" },
+ ],
+ },
+ {
+ title: "Unternehmen",
+ links: [
+ { label: "Über uns", href: "/ueber-uns" },
+ { label: "Motivation", href: "/motivation" },
+ { label: "complex care solutions GmbH", href: "https://complexcaresolutions.de" },
+ ],
+ },
+ {
+ title: "Rechtliches",
+ links: [
+ { label: "Impressum", href: "/impressum" },
+ { label: "Datenschutz", href: "/datenschutz" },
+ ],
+ },
+ ]
+
return (