feat: connect header and footer to cms as globals

This commit is contained in:
syntaxbullet
2026-06-16 14:25:58 +02:00
parent 6b395e5735
commit cde2164773
13 changed files with 842 additions and 456 deletions

View File

@@ -106,7 +106,7 @@ export interface Config {
'payload-migrations': PayloadMigrationsSelect<false> | PayloadMigrationsSelect<true>;
};
db: {
defaultIDType: string;
defaultIDType: number;
};
fallbackLocale: null;
globals: {
@@ -156,7 +156,7 @@ export interface UserAuthOperations {
* via the `definition` "pages".
*/
export interface Page {
id: string;
id: number;
title: string;
hero: {
type: 'none' | 'highImpact' | 'mediumImpact' | 'lowImpact';
@@ -183,11 +183,11 @@ export interface Page {
reference?:
| ({
relationTo: 'pages';
value: string | Page;
value: number | Page;
} | null)
| ({
relationTo: 'posts';
value: string | Post;
value: number | Post;
} | null);
url?: string | null;
label: string;
@@ -199,7 +199,7 @@ export interface Page {
id?: string | null;
}[]
| null;
media?: (string | null) | Media;
media?: (number | null) | Media;
};
layout: (CallToActionBlock | ContentBlock | MediaBlock | ArchiveBlock | FormBlock)[];
meta?: {
@@ -207,7 +207,7 @@ export interface Page {
/**
* Maximum upload file size: 12MB. Recommended file size for images is <500KB.
*/
image?: (string | null) | Media;
image?: (number | null) | Media;
description?: string | null;
};
publishedAt?: string | null;
@@ -225,9 +225,9 @@ export interface Page {
* via the `definition` "posts".
*/
export interface Post {
id: string;
id: number;
title: string;
heroImage?: (string | null) | Media;
heroImage?: (number | null) | Media;
content: {
root: {
type: string;
@@ -243,18 +243,18 @@ export interface Post {
};
[k: string]: unknown;
};
relatedPosts?: (string | Post)[] | null;
categories?: (string | Category)[] | null;
relatedPosts?: (number | Post)[] | null;
categories?: (number | Category)[] | null;
meta?: {
title?: string | null;
/**
* Maximum upload file size: 12MB. Recommended file size for images is <500KB.
*/
image?: (string | null) | Media;
image?: (number | null) | Media;
description?: string | null;
};
publishedAt?: string | null;
authors?: (string | User)[] | null;
authors?: (number | User)[] | null;
populatedAuthors?:
| {
id?: string | null;
@@ -275,7 +275,7 @@ export interface Post {
* via the `definition` "media".
*/
export interface Media {
id: string;
id: number;
alt?: string | null;
caption?: {
root: {
@@ -292,7 +292,7 @@ export interface Media {
};
[k: string]: unknown;
} | null;
folder?: (string | null) | FolderInterface;
folder?: (number | null) | FolderInterface;
updatedAt: string;
createdAt: string;
url?: string | null;
@@ -368,18 +368,18 @@ export interface Media {
* via the `definition` "payload-folders".
*/
export interface FolderInterface {
id: string;
id: number;
name: string;
folder?: (string | null) | FolderInterface;
folder?: (number | null) | FolderInterface;
documentsAndFolders?: {
docs?: (
| {
relationTo?: 'payload-folders';
value: string | FolderInterface;
value: number | FolderInterface;
}
| {
relationTo?: 'media';
value: string | Media;
value: number | Media;
}
)[];
hasNextPage?: boolean;
@@ -394,17 +394,17 @@ export interface FolderInterface {
* via the `definition` "categories".
*/
export interface Category {
id: string;
id: number;
title: string;
/**
* When enabled, the slug will auto-generate from the title field on save and autosave.
*/
generateSlug?: boolean | null;
slug: string;
parent?: (string | null) | Category;
parent?: (number | null) | Category;
breadcrumbs?:
| {
doc?: (string | null) | Category;
doc?: (number | null) | Category;
url?: string | null;
label?: string | null;
id?: string | null;
@@ -418,7 +418,7 @@ export interface Category {
* via the `definition` "users".
*/
export interface User {
id: string;
id: number;
name?: string | null;
updatedAt: string;
createdAt: string;
@@ -467,11 +467,11 @@ export interface CallToActionBlock {
reference?:
| ({
relationTo: 'pages';
value: string | Page;
value: number | Page;
} | null)
| ({
relationTo: 'posts';
value: string | Post;
value: number | Post;
} | null);
url?: string | null;
label: string;
@@ -517,11 +517,11 @@ export interface ContentBlock {
reference?:
| ({
relationTo: 'pages';
value: string | Page;
value: number | Page;
} | null)
| ({
relationTo: 'posts';
value: string | Post;
value: number | Post;
} | null);
url?: string | null;
label: string;
@@ -542,7 +542,7 @@ export interface ContentBlock {
* via the `definition` "MediaBlock".
*/
export interface MediaBlock {
media: string | Media;
media: number | Media;
id?: string | null;
blockName?: string | null;
blockType: 'mediaBlock';
@@ -569,12 +569,12 @@ export interface ArchiveBlock {
} | null;
populateBy?: ('collection' | 'selection') | null;
relationTo?: 'posts' | null;
categories?: (string | Category)[] | null;
categories?: (number | Category)[] | null;
limit?: number | null;
selectedDocs?:
| {
relationTo: 'posts';
value: string | Post;
value: number | Post;
}[]
| null;
id?: string | null;
@@ -586,7 +586,7 @@ export interface ArchiveBlock {
* via the `definition` "FormBlock".
*/
export interface FormBlock {
form: string | Form;
form: number | Form;
enableIntro?: boolean | null;
introContent?: {
root: {
@@ -612,7 +612,7 @@ export interface FormBlock {
* via the `definition` "forms".
*/
export interface Form {
id: string;
id: number;
title: string;
fields?:
| (
@@ -786,7 +786,7 @@ export interface Form {
* via the `definition` "redirects".
*/
export interface Redirect {
id: string;
id: number;
/**
* You will need to rebuild the website when changing this field.
*/
@@ -796,11 +796,11 @@ export interface Redirect {
reference?:
| ({
relationTo: 'pages';
value: string | Page;
value: number | Page;
} | null)
| ({
relationTo: 'posts';
value: string | Post;
value: number | Post;
} | null);
url?: string | null;
};
@@ -812,8 +812,8 @@ export interface Redirect {
* via the `definition` "form-submissions".
*/
export interface FormSubmission {
id: string;
form: string | Form;
id: number;
form: number | Form;
submissionData?:
| {
field: string;
@@ -831,18 +831,18 @@ export interface FormSubmission {
* via the `definition` "search".
*/
export interface Search {
id: string;
id: number;
title?: string | null;
priority?: number | null;
doc: {
relationTo: 'posts';
value: string | Post;
value: number | Post;
};
slug?: string | null;
meta?: {
title?: string | null;
description?: string | null;
image?: (string | null) | Media;
image?: (number | null) | Media;
};
categories?:
| {
@@ -860,7 +860,7 @@ export interface Search {
* via the `definition` "payload-kv".
*/
export interface PayloadKv {
id: string;
id: number;
key: string;
data:
| {
@@ -877,7 +877,7 @@ export interface PayloadKv {
* via the `definition` "payload-jobs".
*/
export interface PayloadJob {
id: string;
id: number;
/**
* Input data provided to the job
*/
@@ -969,52 +969,52 @@ export interface PayloadJob {
* via the `definition` "payload-locked-documents".
*/
export interface PayloadLockedDocument {
id: string;
id: number;
document?:
| ({
relationTo: 'pages';
value: string | Page;
value: number | Page;
} | null)
| ({
relationTo: 'posts';
value: string | Post;
value: number | Post;
} | null)
| ({
relationTo: 'media';
value: string | Media;
value: number | Media;
} | null)
| ({
relationTo: 'categories';
value: string | Category;
value: number | Category;
} | null)
| ({
relationTo: 'users';
value: string | User;
value: number | User;
} | null)
| ({
relationTo: 'redirects';
value: string | Redirect;
value: number | Redirect;
} | null)
| ({
relationTo: 'forms';
value: string | Form;
value: number | Form;
} | null)
| ({
relationTo: 'form-submissions';
value: string | FormSubmission;
value: number | FormSubmission;
} | null)
| ({
relationTo: 'search';
value: string | Search;
value: number | Search;
} | null)
| ({
relationTo: 'payload-folders';
value: string | FolderInterface;
value: number | FolderInterface;
} | null);
globalSlug?: string | null;
user: {
relationTo: 'users';
value: string | User;
value: number | User;
};
updatedAt: string;
createdAt: string;
@@ -1024,10 +1024,10 @@ export interface PayloadLockedDocument {
* via the `definition` "payload-preferences".
*/
export interface PayloadPreference {
id: string;
id: number;
user: {
relationTo: 'users';
value: string | User;
value: number | User;
};
key?: string | null;
value?:
@@ -1047,7 +1047,7 @@ export interface PayloadPreference {
* via the `definition` "payload-migrations".
*/
export interface PayloadMigration {
id: string;
id: number;
name?: string | null;
batch?: number | null;
updatedAt: string;
@@ -1636,24 +1636,64 @@ export interface PayloadMigrationsSelect<T extends boolean = true> {
* via the `definition` "header".
*/
export interface Header {
id: string;
id: number;
/**
* Falls leer, wird /bmp-logo.png verwendet.
*/
logo?: (number | null) | Media;
overlayLogoAlt: string;
overlayKicker: string;
overlayHeadline: string;
mobileWatermark: string;
menuLabel: string;
openLabel: string;
closeLabel: string;
overviewLabel: string;
navItems?:
| {
link: {
type?: ('reference' | 'custom') | null;
newTab?: boolean | null;
reference?:
| ({
relationTo: 'pages';
value: string | Page;
} | null)
| ({
relationTo: 'posts';
value: string | Post;
} | null);
url?: string | null;
label: string;
};
/**
* Stable internal key, e.g. presse.
*/
key: string;
label: string;
path: string;
subLabel?: string | null;
sub?:
| {
label: string;
path: string;
id?: string | null;
}[]
| null;
id?: string | null;
}[]
| null;
secondaryLinks?:
| {
label: string;
path: string;
id?: string | null;
}[]
| null;
ctas?:
| {
label: string;
path: string;
variant?: ('primary' | 'secondary' | 'upload') | null;
id?: string | null;
}[]
| null;
socialLinks?:
| {
label: string;
href: string;
icon: 'instagram' | 'linkedin' | 'facebook';
id?: string | null;
}[]
| null;
languages?:
| {
label: string;
id?: string | null;
}[]
| null;
@@ -1665,24 +1705,51 @@ export interface Header {
* via the `definition` "footer".
*/
export interface Footer {
id: string;
navItems?:
id: number;
/**
* Falls leer, wird /bmp-logo.png verwendet.
*/
logo?: (number | null) | Media;
logoAlt: string;
headlinePrefix: string;
headlineAccent: string;
headlineSuffix: string;
sinceLabel: string;
year: string;
description: string;
copyright: string;
ctas?:
| {
link: {
type?: ('reference' | 'custom') | null;
newTab?: boolean | null;
reference?:
| ({
relationTo: 'pages';
value: string | Page;
} | null)
| ({
relationTo: 'posts';
value: string | Post;
} | null);
url?: string | null;
label: string;
path: string;
variant?: ('primary' | 'secondary' | 'subtle') | null;
id?: string | null;
}[]
| null;
linkColumns?:
| {
label: string;
links: {
label: string;
};
path: string;
id?: string | null;
}[];
id?: string | null;
}[]
| null;
partnerLabel: string;
partnerLogos?:
| {
image: number | Media;
alt: string;
id?: string | null;
}[]
| null;
socialLinks?:
| {
label: string;
href: string;
icon: 'instagram' | 'linkedin' | 'facebook';
id?: string | null;
}[]
| null;
@@ -1694,20 +1761,60 @@ export interface Footer {
* via the `definition` "header_select".
*/
export interface HeaderSelect<T extends boolean = true> {
logo?: T;
overlayLogoAlt?: T;
overlayKicker?: T;
overlayHeadline?: T;
mobileWatermark?: T;
menuLabel?: T;
openLabel?: T;
closeLabel?: T;
overviewLabel?: T;
navItems?:
| T
| {
link?:
key?: T;
label?: T;
path?: T;
subLabel?: T;
sub?:
| T
| {
type?: T;
newTab?: T;
reference?: T;
url?: T;
label?: T;
path?: T;
id?: T;
};
id?: T;
};
secondaryLinks?:
| T
| {
label?: T;
path?: T;
id?: T;
};
ctas?:
| T
| {
label?: T;
path?: T;
variant?: T;
id?: T;
};
socialLinks?:
| T
| {
label?: T;
href?: T;
icon?: T;
id?: T;
};
languages?:
| T
| {
label?: T;
id?: T;
};
updatedAt?: T;
createdAt?: T;
globalType?: T;
@@ -1717,20 +1824,52 @@ export interface HeaderSelect<T extends boolean = true> {
* via the `definition` "footer_select".
*/
export interface FooterSelect<T extends boolean = true> {
navItems?:
logo?: T;
logoAlt?: T;
headlinePrefix?: T;
headlineAccent?: T;
headlineSuffix?: T;
sinceLabel?: T;
year?: T;
description?: T;
copyright?: T;
ctas?:
| T
| {
link?:
label?: T;
path?: T;
variant?: T;
id?: T;
};
linkColumns?:
| T
| {
label?: T;
links?:
| T
| {
type?: T;
newTab?: T;
reference?: T;
url?: T;
label?: T;
path?: T;
id?: T;
};
id?: T;
};
partnerLabel?: T;
partnerLogos?:
| T
| {
image?: T;
alt?: T;
id?: T;
};
socialLinks?:
| T
| {
label?: T;
href?: T;
icon?: T;
id?: T;
};
updatedAt?: T;
createdAt?: T;
globalType?: T;
@@ -1756,14 +1895,14 @@ export interface TaskSchedulePublish {
doc?:
| ({
relationTo: 'pages';
value: string | Page;
value: number | Page;
} | null)
| ({
relationTo: 'posts';
value: string | Post;
value: number | Post;
} | null);
global?: string | null;
user?: (string | null) | User;
user?: (number | null) | User;
};
output?: unknown;
}