Kontaktseite: eigene /kontakt mit Hero + Formular
Neue /kontakt-Seite (Hero + wiederverwendete contact-form-Komponente, ohne Intro-Block). Behebt die bisher ins 404 laufenden "Kontakt aufnehmen"-CTAs. - contact-form: optionales $intro + Rücksprung-Slug $return (Hidden-Feld) - contact-submit: PRG-Redirect zur absendenden Seite, whitelist-validiert gegen routes.php (kein Open-Redirect) - Verlinkt im Footer-Rechtsbereich und im Menü "Der Verein" Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HGzc6GhWhmLJt1jC2q1SRZ
This commit is contained in:
@@ -4,12 +4,18 @@ declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* Kontaktformular (Felder wie auf der alten Seite). Props:
|
||||
* $intro array{title, text}
|
||||
* $intro array{title, text}|null — optionaler Intro-Block (Überschrift, Teaser, Direkt-Mail).
|
||||
* Weglassen → nur das Formular (z. B. auf /kontakt, wo der Hero den Kontext liefert).
|
||||
* $return string optional — Slug der absendenden Seite (Default '' = Startseite). Die Action
|
||||
* leitet nach PRG hierher zurück (whitelist-validiert), damit /kontakt nicht auf die
|
||||
* Startseite springt.
|
||||
* Felder rendern ausschließlich über component('form-field') — siehe CLAUDE.md.
|
||||
* Liest Flash-Status aus Query-Params (?sent=1 / ?error=...) — PRG-Muster.
|
||||
* Spam-Schutz: Honeypot "company_url" + signierter Timestamp "ft" (form_token()).
|
||||
*/
|
||||
$club = json_load('club');
|
||||
$return = $return ?? '';
|
||||
$intro = $intro ?? null;
|
||||
|
||||
$interests = ['Herrenfußball', 'Damenfußball', 'Jugendfußball', 'Turnen', 'Sonstiges'];
|
||||
|
||||
@@ -37,11 +43,13 @@ $f = [
|
||||
?>
|
||||
<section class="section contact" id="kontakt">
|
||||
<div class="container contact__inner">
|
||||
<?php if (!empty($intro)): ?>
|
||||
<div class="contact__intro">
|
||||
<h2><?= e($intro['title']) ?></h2>
|
||||
<p><?= e($intro['text']) ?></p>
|
||||
<p class="text-muted">Oder direkt per Mail an <a href="mailto:<?= e($club['email']) ?>"><?= e($club['email']) ?></a></p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<form class="form" method="post" action="<?= e(url('kontakt-senden')) ?>" novalidate>
|
||||
<div class="form__status" role="status" aria-live="polite" tabindex="-1" data-form-status>
|
||||
<?php if ($sent): ?>
|
||||
@@ -73,6 +81,7 @@ $f = [
|
||||
<input type="text" id="contact-company-url" name="company_url" tabindex="-1" autocomplete="off">
|
||||
</div>
|
||||
<input type="hidden" name="ft" value="<?= e(form_token()) ?>">
|
||||
<input type="hidden" name="return" value="<?= e($return) ?>">
|
||||
|
||||
<p class="form__submit">
|
||||
<button class="btn" type="submit">Nachricht senden</button>
|
||||
|
||||
Reference in New Issue
Block a user