From f0b23b37b923f8d714007967396dd84d7c5a9757 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Mon, 26 Oct 2026 09:17:16 +0100 Subject: [PATCH] feat: the newsletter form submits with htmx and reports failed signups The newsletter subscription plugin now sits in a form island like the EXT:form forms: hx-boost posts to the page itself and only #newsletter-island is swapped (validation errors, confirmation), with the spinner overlay while the request runs. The id keeps htmx away from other islands on the same page (both newsletter pages have hidden EXT:form forms). Without JavaScript the form still posts normally. The island markup moves from Form/Render.html into Partials/Form/Island.html, shared by both; the form plugin's partial path is now Partials/ for that. The comment about static pages is gone with it, static rendering is retired. When the MyE&P API call fails, the result page shows an error with a link back to the form instead of the thank-you message. Co-Authored-By: Claude Opus 5.5 --- .../TypoScript/Extensions/Form.typoscript | 4 +- .../Private/Partials/Form/Island.html | 19 +++ .../Private/Templates/Form/Render.html | 25 +-- .../Newsletter/SubscriptionForm.html | 148 +++++++++--------- .../Newsletter/SubscriptionFormSubmit.html | 44 ++++-- 5 files changed, 132 insertions(+), 108 deletions(-) create mode 100644 packages/ep_theme/Resources/Private/Partials/Form/Island.html diff --git a/packages/ep_theme/Configuration/TypoScript/Extensions/Form.typoscript b/packages/ep_theme/Configuration/TypoScript/Extensions/Form.typoscript index 0db0536..a3853a2 100644 --- a/packages/ep_theme/Configuration/TypoScript/Extensions/Form.typoscript +++ b/packages/ep_theme/Configuration/TypoScript/Extensions/Form.typoscript @@ -4,8 +4,8 @@ plugin.tx_form.view { templateRootPaths.10 = EXT:ep_theme/Resources/Private/Templates/Form/ - # Spinner.html for Render.html - partialRootPaths.10 = EXT:ep_theme/Resources/Private/Partials/Form/ + # Form/Island.html for Render.html + partialRootPaths.10 = EXT:ep_theme/Resources/Private/Partials/ } plugin.tx_form.settings.yamlConfigurations { diff --git a/packages/ep_theme/Resources/Private/Partials/Form/Island.html b/packages/ep_theme/Resources/Private/Partials/Form/Island.html new file mode 100644 index 0000000..b0051cc --- /dev/null +++ b/packages/ep_theme/Resources/Private/Partials/Form/Island.html @@ -0,0 +1,19 @@ + +
+ {content -> f:format.raw()} + + +
+ diff --git a/packages/ep_theme/Resources/Private/Templates/Form/Render.html b/packages/ep_theme/Resources/Private/Templates/Form/Render.html index 73d4b8b..a249332 100644 --- a/packages/ep_theme/Resources/Private/Templates/Form/Render.html +++ b/packages/ep_theme/Resources/Private/Templates/Form/Render.html @@ -1,31 +1,10 @@ - - Every form sits in a .form-island, on pages TYPO3 13 renders as well as in the form page type - (/path/form) that the static pages load: the form posts there, and htmx swaps the island as a - whole (see Form.html). While a request runs, htmx sets htmx-request on it and the overlay - covers the form. Styled here and not in the theme build: the static pages around the island - load the CSS of the TYPO3 10 export. The spinner takes the button colour of each theme. - -
+
- - -
+ diff --git a/packages/ep_theme/Resources/Private/Templates/Newsletter/SubscriptionForm.html b/packages/ep_theme/Resources/Private/Templates/Newsletter/SubscriptionForm.html index c66150f..30e2546 100644 --- a/packages/ep_theme/Resources/Private/Templates/Newsletter/SubscriptionForm.html +++ b/packages/ep_theme/Resources/Private/Templates/Newsletter/SubscriptionForm.html @@ -5,82 +5,90 @@ -
- -
-
- - - -
- - - - - - + +
+ +
+
+ + + +
+ + + + + + +
+
- -
-
- - - - - -

- News & Angebote per Mail -

-
- - - - - -

- Benachrichtige mich bei Verfügbarkeit -

-
-
-
-
- -
- - - -
-
-
-
- -
-
-
-
+ +
+
diff --git a/packages/ep_theme/Resources/Private/Templates/Newsletter/SubscriptionFormSubmit.html b/packages/ep_theme/Resources/Private/Templates/Newsletter/SubscriptionFormSubmit.html index 3e55f69..ba5aa1d 100644 --- a/packages/ep_theme/Resources/Private/Templates/Newsletter/SubscriptionFormSubmit.html +++ b/packages/ep_theme/Resources/Private/Templates/Newsletter/SubscriptionFormSubmit.html @@ -4,20 +4,38 @@ -
-
-

- Vielen Dank für dein Interesse -

-

- Deine Anmeldung muss noch bestätigt werden. Bitte nutze den Link aus der Bestätigungs-E-Mail, die in - Kürze bei dir eintreffen sollte. -

-

- Sieh am besten auch im Spam-Ordner nach. -

+ + +
+ + +
+

+ Vielen Dank für dein Interesse +

+

+ Deine Anmeldung muss noch bestätigt werden. Bitte nutze den Link aus der Bestätigungs-E-Mail, die in + Kürze bei dir eintreffen sollte. +

+

+ Sieh am besten auch im Spam-Ordner nach. +

+
+
+ + + +
-
+