Querschnitt-Verbesserungen ohne eigenes Feature: - Navigation: Untermenü-Trenner (separator) + Mitmachen-Link, rote Akzent-Leiste - Startseiten-Hero zentriert (align center, ohne Hero-CTAs); .hero--center-Styles - person-card/person-grid: Kontakt-Layout, 3-Spalten-Raster (Startseite) - jsonld: geo aus club.json; cta unterstützt #hash-Anker - verein: hartcodierten Maps-Link/Inline-CTA entfernt, .facility zentriert - tokens: Sepia-Farben für Timeline; base: globale p-max-width entfernt - historie: Timeline um 2024/2025 ergänzt - Icons link-45deg (Footer) und robot (meta) nachgereicht Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HGzc6GhWhmLJt1jC2q1SRZ
56 lines
2.0 KiB
PHP
56 lines
2.0 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/**
|
|
* Ansprechpartner-Grid aus data/ansprechpartner.json (Single Source of Truth).
|
|
* Alle Props optional:
|
|
* $departments array — nur diese Abteilungen zeigen (z. B. ['Herrenfußball','Damenfußball']).
|
|
* $names array — zusätzlich auf diese Namen einschränken (z. B. ['Benedikt Höfner']).
|
|
* $title string — Überschrift überschreiben (Default aus JSON).
|
|
* $intro string — Intro-Text überschreiben (Default aus JSON; '' = ausblenden).
|
|
* $anchor string — Sektions-ID (Default 'ansprechpartner').
|
|
* $tinted bool — aufgehelltes Vollbreite-Band (Default true).
|
|
* $columns int — Spaltenanzahl auf Desktop (null = automatisch bis 5).
|
|
*/
|
|
$data = json_load('ansprechpartner');
|
|
$anchor = $anchor ?? 'ansprechpartner';
|
|
$tinted = $tinted ?? true;
|
|
$columns = $columns ?? null;
|
|
$title = $title ?? $data['title'];
|
|
$intro = $intro ?? ($data['intro'] ?? '');
|
|
|
|
$persons = $data['persons'] ?? [];
|
|
if (!empty($departments)) {
|
|
$persons = array_values(array_filter(
|
|
$persons,
|
|
static fn (array $p): bool => in_array($p['department'] ?? '', $departments, true)
|
|
));
|
|
}
|
|
if (!empty($names)) {
|
|
$persons = array_values(array_filter(
|
|
$persons,
|
|
static fn (array $p): bool => in_array($p['name'] ?? '', $names, true)
|
|
));
|
|
}
|
|
|
|
if ($persons === []) {
|
|
return;
|
|
}
|
|
?>
|
|
<section class="section persons<?= $tinted ? ' section--tinted' : '' ?>" id="<?= e($anchor) ?>">
|
|
<div class="container">
|
|
<h2><?= e($title) ?></h2>
|
|
<?php if ($intro !== ''): ?>
|
|
<p class="persons__intro"><?= e($intro) ?></p>
|
|
<?php endif; ?>
|
|
<ul class="persons__grid<?= $columns ? ' persons__grid--cols-' . (int)$columns : '' ?>">
|
|
<?php foreach ($persons as $person): ?>
|
|
<li>
|
|
<?php component('person-card', ['person' => $person]); ?>
|
|
</li>
|
|
<?php endforeach; ?>
|
|
</ul>
|
|
</div>
|
|
</section>
|