General rule: links to another host open in a new tab with rel="noopener noreferrer"; internal paths, mailto: and tel: stay in the same tab. Behaviour was inconsistent before — the home Webmail button opened in the same tab while the other webmail links did not, and the CTA and header relied on a manual "external" switch. src/lib/external-link.ts decides from the URL (externalLinkProps for JSX, openExternalLinksInNewTab for CMS-provided HTML in About paragraphs, legal pages and the GDPR label). All link sites use it; the manual "external" CTA checkbox and NavigationItem flag are removed so the rule cannot be bypassed. Rule documented in architecture.md and CLAUDE.md; staging smoke SMOKE-07 checks every external homepage link. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
101 lines
3.5 KiB
TypeScript
101 lines
3.5 KiB
TypeScript
import type { GlobalConfig } from 'payload'
|
|
|
|
import { stringArrayField } from './fields/stringArray'
|
|
import { ctaLinkGroup } from './fields/ctaLink'
|
|
import { globalVersions } from '../lib/payload-versions'
|
|
|
|
/**
|
|
* Mirrors HomePageContent (proto/src/content/types.ts) — MITHOME-87.
|
|
*
|
|
* WHY nincs `partners` mező: a home.partners.items a JSON-ban ma egy
|
|
* beágyazott lista, de a Payload oldalon önálló `Partners` collection lesz
|
|
* (logó = Media upload reference) — lásd MITHOME-89. Itt szándékosan
|
|
* kihagyjuk, nehogy két, egymásnak ellentmondó forrás legyen.
|
|
*
|
|
* MITHOME-111 lokalizáció: minden fordítható szöveg `localized: true`; az
|
|
* `icon` és a sor-`id` közös. WHY a `cta.*.href` is
|
|
* lokalizált: egy külső cél nyelvenként eltérhet. Belső oldalra a CTA
|
|
* oldalválasztóval mutat (MITHOME-123, fields/ctaLink.ts) — a nyelvhelyes
|
|
* útvonalat a frontend számolja (/hu/kapcsolat vs /en/contact). A
|
|
* string-listák (trustBullets, features) tömb-szinten lokalizáltak —
|
|
* nyelvenként eltérő elemszám lehet.
|
|
*/
|
|
export const Home: GlobalConfig = {
|
|
slug: 'home',
|
|
admin: {
|
|
group: 'Oldalak',
|
|
},
|
|
versions: globalVersions,
|
|
fields: [
|
|
{
|
|
name: 'hero',
|
|
type: 'group',
|
|
fields: [
|
|
{ name: 'title', type: 'text', required: true, localized: true },
|
|
{ name: 'subtitle', type: 'text', required: true, localized: true },
|
|
{ name: 'description', type: 'textarea', required: true, localized: true },
|
|
stringArrayField('trustBullets', 'Trust bullets', { localized: true }),
|
|
{
|
|
name: 'cta',
|
|
type: 'group',
|
|
fields: [
|
|
ctaLinkGroup('primary'),
|
|
ctaLinkGroup('secondary'),
|
|
],
|
|
},
|
|
],
|
|
},
|
|
{
|
|
name: 'about',
|
|
type: 'group',
|
|
fields: [
|
|
{ name: 'title', type: 'text', required: true, localized: true },
|
|
{
|
|
name: 'usps',
|
|
type: 'array',
|
|
fields: [
|
|
{ name: 'id', type: 'text', required: true },
|
|
{ name: 'title', type: 'text', required: true, localized: true },
|
|
{ name: 'description', type: 'textarea', required: true, localized: true },
|
|
{ name: 'icon', type: 'text', required: true },
|
|
],
|
|
},
|
|
],
|
|
},
|
|
{
|
|
name: 'services',
|
|
type: 'group',
|
|
fields: [
|
|
{ name: 'title', type: 'text', required: true, localized: true },
|
|
{ name: 'subtitle', type: 'text', required: true, localized: true },
|
|
{
|
|
name: 'items',
|
|
type: 'array',
|
|
fields: [
|
|
{ name: 'id', type: 'text', required: true },
|
|
{ name: 'title', type: 'text', required: true, localized: true },
|
|
{ name: 'description', type: 'textarea', required: true, localized: true },
|
|
{ name: 'icon', type: 'text', required: true },
|
|
stringArrayField('features', 'Features', { localized: true }),
|
|
{ name: 'ctaText', type: 'text', required: true, localized: true },
|
|
],
|
|
},
|
|
],
|
|
},
|
|
{
|
|
name: 'cta',
|
|
type: 'group',
|
|
fields: [
|
|
{ name: 'title', type: 'text', required: true, localized: true },
|
|
{ name: 'subtitle', type: 'textarea', required: true, localized: true },
|
|
{ name: 'button', type: 'text', required: true, localized: true },
|
|
],
|
|
},
|
|
{
|
|
name: 'serviceFeatures',
|
|
type: 'group',
|
|
fields: [{ name: 'title', type: 'text', required: true, localized: true }],
|
|
},
|
|
],
|
|
}
|