mirror of
https://github.com/complexcaresolutions/cms.c2sgmbh.git
synced 2026-03-17 13:54:11 +00:00
feat: add HtmlEmbedBlock and convert zweitmeinu.ng static pages to CMS
Add html-embed-block for raw HTML/iframe embedding in Pages layout. Update seed script with hero blocks for impressum/datenschutz and alfright.eu iframe via html-embed-block for privacy policy page. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
7fc0d7c13a
commit
5cd3f8a1b7
6 changed files with 109 additions and 15 deletions
|
|
@ -1627,32 +1627,37 @@ async function seed() {
|
|||
slug: 'impressum',
|
||||
status: 'published',
|
||||
layout: [
|
||||
{
|
||||
blockType: 'hero-block',
|
||||
headline: 'Impressum',
|
||||
alignment: 'center',
|
||||
overlay: true,
|
||||
},
|
||||
{
|
||||
blockType: 'text-block',
|
||||
width: 'medium',
|
||||
width: 'narrow',
|
||||
content: createRichTextComplex([
|
||||
{ type: 'heading', tag: 'h1', text: 'Impressum' },
|
||||
{ type: 'paragraph', text: 'complex care solutions GmbH' },
|
||||
{ type: 'paragraph-bold', text: 'complex care solutions GmbH' },
|
||||
{ type: 'paragraph', text: 'Hans-Böckler-Str. 19' },
|
||||
{ type: 'paragraph', text: '46236 Bottrop' },
|
||||
{ type: 'heading', tag: 'h3', text: 'Handelsregister' },
|
||||
{ type: 'heading', tag: 'h2', text: 'Handelsregister' },
|
||||
{ type: 'paragraph', text: 'Handelsregister: HRB 15753' },
|
||||
{ type: 'paragraph', text: 'Registergericht: Gelsenkirchen' },
|
||||
{ type: 'heading', tag: 'h3', text: 'Vertreten durch' },
|
||||
{ type: 'heading', tag: 'h2', text: 'Vertreten durch' },
|
||||
{ type: 'paragraph', text: 'Martin Porwoll' },
|
||||
{ type: 'heading', tag: 'h3', text: 'Kontakt' },
|
||||
{ type: 'heading', tag: 'h2', text: 'Kontakt' },
|
||||
{ type: 'paragraph', text: 'Telefon: 0800 80 44 100' },
|
||||
{ type: 'paragraph', text: 'Telefax: 0800 80 44 190' },
|
||||
{ type: 'paragraph', text: 'E-Mail: kontakt@complexcaresolutions.de' },
|
||||
{ type: 'heading', tag: 'h3', text: 'Umsatzsteuer-ID' },
|
||||
{ type: 'heading', tag: 'h2', text: 'Umsatzsteuer-ID' },
|
||||
{ type: 'paragraph', text: 'Umsatzsteuer-Identifikationsnummer gemäß § 27 a Umsatzsteuergesetz: DE334815479' },
|
||||
{ type: 'heading', tag: 'h3', text: 'Redaktionell verantwortlich' },
|
||||
{ type: 'heading', tag: 'h2', text: 'Redaktionell verantwortlich' },
|
||||
{ type: 'paragraph', text: 'Martin Porwoll' },
|
||||
{ type: 'paragraph', text: 'Hans-Böckler-Str. 19' },
|
||||
{ type: 'paragraph', text: '46236 Bottrop' },
|
||||
{ type: 'heading', tag: 'h3', text: 'EU-Streitschlichtung' },
|
||||
{ type: 'heading', tag: 'h2', text: 'EU-Streitschlichtung' },
|
||||
{ type: 'paragraph', text: 'Die Europäische Kommission stellt eine Plattform zur Online-Streitbeilegung (OS) bereit: https://ec.europa.eu/consumers/odr/. Unsere E-Mail-Adresse finden Sie oben im Impressum.' },
|
||||
{ type: 'heading', tag: 'h3', text: 'Verbraucherstreitbeilegung/Universalschlichtungsstelle' },
|
||||
{ type: 'heading', tag: 'h2', text: 'Verbraucherstreitbeilegung/Universalschlichtungsstelle' },
|
||||
{ type: 'paragraph', text: 'Wir sind nicht bereit oder verpflichtet, an Streitbeilegungsverfahren vor einer Verbraucherschlichtungsstelle teilzunehmen.' },
|
||||
]),
|
||||
},
|
||||
|
|
@ -1670,11 +1675,16 @@ async function seed() {
|
|||
status: 'published',
|
||||
layout: [
|
||||
{
|
||||
blockType: 'text-block',
|
||||
width: 'full',
|
||||
content: createRichText(
|
||||
'Die Datenschutzerklärung wird über unseren externen Datenschutzbeauftragten alfright.eu bereitgestellt.',
|
||||
),
|
||||
blockType: 'hero-block',
|
||||
headline: 'Datenschutzerklärung',
|
||||
alignment: 'center',
|
||||
overlay: true,
|
||||
},
|
||||
{
|
||||
blockType: 'html-embed-block',
|
||||
title: 'Alfright Datenschutzgenerator',
|
||||
code: '<iframe src="https://app.alfright.eu/ext/dps/alfright_schutzteam/9f315103c43245bcb0806dd56c2be757?lang=de-de&headercolor=%23131F64&headerfont=Arial&headersize=21px&subheadersize=18px&fontcolor=%23333333&textfont=Arial&textsize=14px&background=%23ffffff&linkcolor=%23337ab7" title="Datenschutzerklärung" width="100%" height="5000" loading="lazy" style="border:none"></iframe>',
|
||||
maxWidth: 'full',
|
||||
},
|
||||
],
|
||||
seo: {
|
||||
|
|
|
|||
35
src/blocks/HtmlEmbedBlock.ts
Normal file
35
src/blocks/HtmlEmbedBlock.ts
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
import type { Block } from 'payload'
|
||||
|
||||
export const HtmlEmbedBlock: Block = {
|
||||
slug: 'html-embed-block',
|
||||
labels: { singular: 'HTML Embed', plural: 'HTML Embeds' },
|
||||
fields: [
|
||||
{
|
||||
name: 'title',
|
||||
type: 'text',
|
||||
label: 'Titel (intern)',
|
||||
admin: { description: 'Nur zur internen Identifikation im CMS' },
|
||||
},
|
||||
{
|
||||
name: 'code',
|
||||
type: 'code',
|
||||
required: true,
|
||||
label: 'HTML Code',
|
||||
admin: {
|
||||
language: 'html',
|
||||
description: 'HTML/iframe Code der eingebettet werden soll',
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'maxWidth',
|
||||
type: 'select',
|
||||
defaultValue: 'full',
|
||||
label: 'Maximale Breite',
|
||||
options: [
|
||||
{ label: 'Schmal (620px)', value: 'narrow' },
|
||||
{ label: 'Mittel (900px)', value: 'medium' },
|
||||
{ label: 'Voll (1280px)', value: 'full' },
|
||||
],
|
||||
},
|
||||
],
|
||||
}
|
||||
|
|
@ -48,6 +48,9 @@ export { ComparisonBlock } from './ComparisonBlock'
|
|||
// Tenant-specific Blocks
|
||||
export { BeforeAfterBlock } from './BeforeAfterBlock'
|
||||
|
||||
// Utility Blocks
|
||||
export { HtmlEmbedBlock } from './HtmlEmbedBlock'
|
||||
|
||||
// BlogWoman Blocks - ENABLED
|
||||
export { FavoritesBlock } from './FavoritesBlock'
|
||||
export { SeriesBlock } from './SeriesBlock'
|
||||
|
|
|
|||
|
|
@ -43,6 +43,8 @@ import {
|
|||
ComparisonBlock,
|
||||
// Tenant-specific Blocks
|
||||
BeforeAfterBlock,
|
||||
// Utility Blocks
|
||||
HtmlEmbedBlock,
|
||||
// BlogWoman Blocks
|
||||
FavoritesBlock,
|
||||
SeriesBlock,
|
||||
|
|
@ -125,6 +127,8 @@ export const Pages: CollectionConfig = {
|
|||
ComparisonBlock,
|
||||
// Tenant-specific Blocks
|
||||
BeforeAfterBlock,
|
||||
// Utility Blocks
|
||||
HtmlEmbedBlock,
|
||||
// BlogWoman Blocks
|
||||
FavoritesBlock,
|
||||
SeriesBlock,
|
||||
|
|
|
|||
36
src/migrations/20260228_150000_add_html_embed_block.ts
Normal file
36
src/migrations/20260228_150000_add_html_embed_block.ts
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
import { MigrateUpArgs, MigrateDownArgs, sql } from '@payloadcms/db-postgres'
|
||||
|
||||
export async function up({ db }: MigrateUpArgs): Promise<void> {
|
||||
await db.execute(sql`
|
||||
DO $$ BEGIN
|
||||
CREATE TYPE "public"."enum_pages_blocks_html_embed_block_max_width" AS ENUM('narrow', 'medium', 'full');
|
||||
EXCEPTION
|
||||
WHEN duplicate_object THEN null;
|
||||
END $$;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS "pages_blocks_html_embed_block" (
|
||||
"_order" integer NOT NULL,
|
||||
"_parent_id" integer NOT NULL,
|
||||
"_path" text NOT NULL,
|
||||
"id" varchar PRIMARY KEY NOT NULL,
|
||||
"title" varchar,
|
||||
"code" varchar NOT NULL,
|
||||
"max_width" "enum_pages_blocks_html_embed_block_max_width" DEFAULT 'full',
|
||||
"block_name" varchar
|
||||
);
|
||||
|
||||
DO $$ BEGIN
|
||||
ALTER TABLE "pages_blocks_html_embed_block" ADD CONSTRAINT "pages_blocks_html_embed_block_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages"("id") ON DELETE cascade ON UPDATE no action;
|
||||
EXCEPTION
|
||||
WHEN duplicate_object THEN null;
|
||||
END $$;
|
||||
|
||||
CREATE INDEX IF NOT EXISTS "pages_blocks_html_embed_block_order_idx" ON "pages_blocks_html_embed_block" USING btree ("_order");
|
||||
CREATE INDEX IF NOT EXISTS "pages_blocks_html_embed_block_parent_id_idx" ON "pages_blocks_html_embed_block" USING btree ("_parent_id");
|
||||
CREATE INDEX IF NOT EXISTS "pages_blocks_html_embed_block_path_idx" ON "pages_blocks_html_embed_block" USING btree ("_path");
|
||||
`)
|
||||
}
|
||||
|
||||
export async function down({ db }: MigrateDownArgs): Promise<void> {
|
||||
// No-op: preserving data
|
||||
}
|
||||
|
|
@ -38,6 +38,7 @@ import * as migration_20260116_120000_add_report_schedules from './20260116_1200
|
|||
import * as migration_20260215_120000_add_monitoring_collections from './20260215_120000_add_monitoring_collections';
|
||||
import * as migration_20260216_150000_add_card_grid_icon_fields from './20260216_150000_add_card_grid_icon_fields';
|
||||
import * as migration_20260217_120000_add_tenant_to_forms from './20260217_120000_add_tenant_to_forms';
|
||||
import * as migration_20260228_150000_add_html_embed_block from './20260228_150000_add_html_embed_block';
|
||||
|
||||
export const migrations = [
|
||||
{
|
||||
|
|
@ -240,4 +241,9 @@ export const migrations = [
|
|||
down: migration_20260217_120000_add_tenant_to_forms.down,
|
||||
name: '20260217_120000_add_tenant_to_forms'
|
||||
},
|
||||
{
|
||||
up: migration_20260228_150000_add_html_embed_block.up,
|
||||
down: migration_20260228_150000_add_html_embed_block.down,
|
||||
name: '20260228_150000_add_html_embed_block'
|
||||
},
|
||||
];
|
||||
|
|
|
|||
Loading…
Reference in a new issue