Files
tsv08kulmbach-website/app/components/faq-contact.php
fs 3b6f630a72 Unterseiten: Fußball-Übersicht, Mannschaften, Jugend, Verein, Rechtliches
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
2026-06-19 08:13:04 +02:00

77 lines
3.3 KiB
PHP

<?php
declare(strict_types=1);
/**
* Kombi-Sektion: FAQ (2/3) + einzelner Ansprechpartner (1/3) nebeneinander.
* Sinnvoll, wenn es pro Mannschaft nur einen Kontakt gibt. Props:
* $faq array [{q, a}]
* $persons array — ein oder mehrere Ansprechpartner (person-card). Leer → FAQ volle Breite.
* Bei mehreren: Mini-Slider (ohne JS alle Karten gestapelt sichtbar).
* $faqTitle string (optional, Default 'Häufige Fragen')
* $faqIntro string (optional) — gedämpfte Subline unter der Überschrift
* $contactTitle string (optional, Default 'Dein Ansprechpartner')
* $anchor string (optional, Default 'kontakt')
* Natives <details>/<summary> (ohne JS bedienbar); FAQPage-Schema liefert die Seite.
*/
$faqTitle = $faqTitle ?? 'Häufige Fragen';
$faqIntro = $faqIntro ?? '';
$contactTitle = $contactTitle ?? 'Dein Ansprechpartner';
$anchor = $anchor ?? 'kontakt';
$faq = array_values(array_filter(
$faq ?? [],
static fn (array $i): bool => !empty($i['q']) && !empty($i['a'])
));
$persons = array_values(array_filter($persons ?? [], static fn ($p): bool => !empty($p)));
$hasPerson = $persons !== [];
$isSlider = count($persons) > 1;
if ($faq === [] && !$hasPerson) {
return;
}
?>
<section class="section faq-contact<?= $hasPerson ? '' : ' faq-contact--solo' ?>" id="<?= e($anchor) ?>">
<div class="container">
<h2 class="faq-contact__title"><?= e($faqTitle) ?></h2>
<?php if ($faqIntro !== ''): ?>
<p class="faq-contact__intro text-muted"><?= e($faqIntro) ?></p>
<?php endif; ?>
<div class="faq-contact__inner">
<div class="faq-contact__main">
<div class="faq__list">
<?php foreach ($faq as $item): ?>
<details class="faq__item">
<summary class="faq__q"><span><?= e($item['q']) ?></span><?= icon('chevron-down', 'faq__chevron') ?></summary>
<div class="faq__a"><p><?= e($item['a']) ?></p></div>
</details>
<?php endforeach; ?>
</div>
</div>
<?php if ($hasPerson): ?>
<aside class="faq-contact__aside">
<?php if ($contactTitle !== ''): ?>
<h2><?= e($contactTitle) ?></h2>
<?php endif; ?>
<?php if ($isSlider): ?>
<div class="contact-slider" data-contact-slider>
<ul class="contact-slider__track">
<?php foreach ($persons as $p): ?>
<li class="contact-slider__slide" data-contact-slide>
<?php component('person-card', ['person' => $p]); ?>
</li>
<?php endforeach; ?>
</ul>
<div class="contact-slider__dots">
<?php foreach ($persons as $i => $p): ?>
<button type="button" class="contact-slider__dot" data-contact-dot<?= $i === 0 ? ' aria-current="true"' : '' ?> aria-label="Ansprechpartner <?= $i + 1 ?>: <?= e($p['name']) ?>"></button>
<?php endforeach; ?>
</div>
</div>
<?php else: ?>
<?php component('person-card', ['person' => $persons[0]]); ?>
<?php endif; ?>
</aside>
<?php endif; ?>
</div>
</div>
</section>