Neue Seiten + Routen: fussball, fussball/{erste-mannschaft,zweite-mannschaft,
damen}, jugendfussball, verein, impressum, datenschutz. Dazu die Komponenten
team, team-cards/-roster/-photo/-bento, faq/faq-contact, key-facts, age-groups,
cta-band, training-location und der contact-slider.
Daten in teams/fussball/jugend/verein.json; club.json um Vorstand, Bankdaten,
Datenschutz-Kontakt erweitert. person-grid bekommt $names-Filter, partner-grid
einen Intro-Stil. Seiten setzen $meta['schema'] via team_/page_schema.
Styles für alle neuen Komponenten in components.css.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KDQZ6FuchNUh2bxSW9PeNv
47 lines
1.6 KiB
PHP
47 lines
1.6 KiB
PHP
<?php
|
||
|
||
declare(strict_types=1);
|
||
|
||
/**
|
||
* Mannschafts-Seite (DRY-Template für 1./2. Herren + Damen). Props:
|
||
* $team array — Eintrag aus data/teams.json.
|
||
* $slug string — voller Seiten-Slug (für Anker-Links).
|
||
* Aufbau: Hero → Team-Bento (Bild, Einleitung, Training, Spielort) → FAQ + Ansprechpartner.
|
||
* Leere Datenblöcke (Training, FAQ, fehlender Kontakt) blenden sich selbst aus.
|
||
*/
|
||
$slug = $slug ?? '';
|
||
|
||
// Ansprechpartner aus der Single-Source auflösen (ein oder mehrere, Reihenfolge wie angegeben).
|
||
$allPersons = json_load('ansprechpartner')['persons'] ?? [];
|
||
$wantDept = $team['contact_department'] ?? '';
|
||
$wantNames = $team['contact_names'] ?? (isset($team['contact_name']) ? [$team['contact_name']] : []);
|
||
$contacts = [];
|
||
foreach ($wantNames as $wn) {
|
||
foreach ($allPersons as $p) {
|
||
if (($p['department'] ?? '') === $wantDept && ($p['name'] ?? '') === $wn) {
|
||
$contacts[] = $p;
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
|
||
component('hero', ['hero' => $team['hero']]);
|
||
|
||
if (!empty($team['team_photo']['image'])) {
|
||
component('team-photo', ['photo' => $team['team_photo'], 'anchor' => 'mannschaftsfoto']);
|
||
}
|
||
|
||
component('team-bento', ['team' => $team, 'anchor' => 'team-info']);
|
||
|
||
if (!empty($team['roster']['members']) || !empty($team['roster']['groups'])) {
|
||
component('team-roster', ['roster' => $team['roster'], 'anchor' => 'kader']);
|
||
}
|
||
|
||
component('faq-contact', [
|
||
'faq' => $team['faq'] ?? [],
|
||
'faqIntro' => 'Die wichtigsten Fragen rund um die ' . ($team['name'] ?? 'Mannschaft') . ' – kurz beantwortet.',
|
||
'persons' => $contacts,
|
||
'contactTitle' => '',
|
||
'anchor' => 'kontakt',
|
||
]);
|