cms.c2sgmbh/src/collections/Pages.ts
Martin Porwoll 8abf3a346e refactor(pages): remove fixed hero group from Pages collection
Hero content is now handled via HeroBlock/HeroSliderBlock in the
flexible layout blocks system, giving editors full control.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 11:17:11 +00:00

175 lines
3.6 KiB
TypeScript

import type { CollectionConfig } from 'payload'
import {
HeroBlock,
HeroSliderBlock,
ImageSliderBlock,
TextBlock,
ImageTextBlock,
CardGridBlock,
QuoteBlock,
CTABlock,
ContactFormBlock,
TimelineBlock,
DividerBlock,
VideoBlock,
// Neue Blocks
PostsListBlock,
TestimonialsBlock,
NewsletterBlock,
ProcessStepsBlock,
FAQBlock,
TeamBlock,
ServicesBlock,
// Blogging Blocks
AuthorBioBlock,
RelatedPostsBlock,
ShareButtonsBlock,
TableOfContentsBlock,
// Team Blocks
TeamFilterBlock,
OrgChartBlock,
// New Feature Blocks
LocationsBlock,
LogoGridBlock,
StatsBlock,
JobsBlock,
DownloadsBlock,
MapBlock,
// Events & Interactive Blocks
EventsBlock,
PricingBlock,
TabsBlock,
AccordionBlock,
ComparisonBlock,
// Tenant-specific Blocks
BeforeAfterBlock,
// BlogWoman Blocks
FavoritesBlock,
SeriesBlock,
SeriesDetailBlock,
VideoEmbedBlock,
FeaturedContentBlock,
} from '../blocks'
import { pagesAccess } from '../lib/access'
export const Pages: CollectionConfig = {
slug: 'pages',
admin: {
useAsTitle: 'title',
defaultColumns: ['title', 'slug', 'status', 'updatedAt'],
},
access: pagesAccess,
fields: [
{
name: 'title',
type: 'text',
required: true,
localized: true,
},
{
name: 'slug',
type: 'text',
required: true,
localized: true,
unique: false, // Uniqueness per locale handled by index
admin: {
description: 'URL-Pfad (z.B. "ueber-uns" / "about-us")',
},
},
{
name: 'layout',
type: 'blocks',
label: 'Seiteninhalt',
blocks: [
// Bestehende Blocks
HeroBlock,
HeroSliderBlock,
ImageSliderBlock,
TextBlock,
ImageTextBlock,
CardGridBlock,
QuoteBlock,
CTABlock,
ContactFormBlock,
TimelineBlock,
DividerBlock,
VideoBlock,
// Neue Blocks
PostsListBlock,
TestimonialsBlock,
NewsletterBlock,
ProcessStepsBlock,
FAQBlock,
TeamBlock,
ServicesBlock,
// Blogging Blocks
AuthorBioBlock,
RelatedPostsBlock,
ShareButtonsBlock,
TableOfContentsBlock,
// Team Blocks
TeamFilterBlock,
OrgChartBlock,
// New Feature Blocks
LocationsBlock,
LogoGridBlock,
StatsBlock,
JobsBlock,
DownloadsBlock,
MapBlock,
// Events & Interactive Blocks
EventsBlock,
PricingBlock,
TabsBlock,
AccordionBlock,
ComparisonBlock,
// Tenant-specific Blocks
BeforeAfterBlock,
// BlogWoman Blocks
FavoritesBlock,
SeriesBlock,
SeriesDetailBlock,
VideoEmbedBlock,
FeaturedContentBlock,
],
},
{
name: 'seo',
type: 'group',
label: 'SEO',
fields: [
{
name: 'metaTitle',
type: 'text',
label: 'Meta-Titel',
localized: true,
},
{
name: 'metaDescription',
type: 'textarea',
label: 'Meta-Beschreibung',
localized: true,
},
{
name: 'ogImage',
type: 'upload',
relationTo: 'media',
label: 'Social Media Bild',
},
],
},
{
name: 'status',
type: 'select',
defaultValue: 'draft',
options: [
{ label: 'Entwurf', value: 'draft' },
{ label: 'Veröffentlicht', value: 'published' },
],
},
{
name: 'publishedAt',
type: 'date',
},
],
}