From 386d89a1e059c37e3765562a931654186fc45b68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Mon, 26 Oct 2026 09:33:32 +0100 Subject: [PATCH] chore: forms post to their own page instead of the form page type The form page type (/form, 1704) existed because on the static pages of the hybrid setup the page URL never reached TYPO3. With static rendering retired, forms post to the page they are on, like the newsletter form: the additionalParams in FormSetup.yaml, Page/Form.typoscript and the /form entries of the PageType enhancers are gone. Each form island gets the id form-island-
(EXT:form appends the content element uid), and Form.html targets and selects that id instead of .form-island. With two forms on one page, a submission no longer swaps in the first form's island. Kept: hx-boost on the forms, HtmxRedirectMiddleware (Redirect finishers under htmx) and /captcha (bw_captcha's image type). Co-Authored-By: Claude Opus 5.5 --- config/sites/ep-reisen/config.yaml | 1 - config/sites/ser/config.yaml | 1 - config/sites/ski-boarderweek/config.yaml | 1 - config/sites/ski-wochenenden/config.yaml | 1 - config/sites/snowzone/config.yaml | 1 - config/sites/unichamp/config.yaml | 1 - .../TypoScript/Page/Form.typoscript | 29 ------------------- .../Configuration/Yaml/FormSetup.yaml | 4 --- .../Private/Templates/Form/Form.html | 6 ++-- .../Private/Templates/Form/Render.html | 2 +- 10 files changed, 4 insertions(+), 43 deletions(-) delete mode 100644 packages/ep_theme/Configuration/TypoScript/Page/Form.typoscript diff --git a/config/sites/ep-reisen/config.yaml b/config/sites/ep-reisen/config.yaml index 2492f0f..180ce57 100644 --- a/config/sites/ep-reisen/config.yaml +++ b/config/sites/ep-reisen/config.yaml @@ -282,7 +282,6 @@ routeEnhancers: /: 0 /json: 1701 /html: 1702 - /form: 1704 /captcha: 3413 .json: 1803 .ical: 1710 diff --git a/config/sites/ser/config.yaml b/config/sites/ser/config.yaml index 1b9afff..292396c 100644 --- a/config/sites/ser/config.yaml +++ b/config/sites/ser/config.yaml @@ -85,7 +85,6 @@ routeEnhancers: default: '' index: '' map: - /form: 1704 /captcha: 3413 routes: - diff --git a/config/sites/ski-boarderweek/config.yaml b/config/sites/ski-boarderweek/config.yaml index 14dc166..f94a40f 100644 --- a/config/sites/ski-boarderweek/config.yaml +++ b/config/sites/ski-boarderweek/config.yaml @@ -66,7 +66,6 @@ routeEnhancers: /: 0 /json: 1701 /html: 1702 - /form: 1704 /captcha: 3413 sitemap.xml: 1533906435 yoast-snippetpreview.json: 1480321830 diff --git a/config/sites/ski-wochenenden/config.yaml b/config/sites/ski-wochenenden/config.yaml index 0956cae..ad7c255 100644 --- a/config/sites/ski-wochenenden/config.yaml +++ b/config/sites/ski-wochenenden/config.yaml @@ -50,7 +50,6 @@ routeEnhancers: /: 0 /json: 1701 /html: 1702 - /form: 1704 /captcha: 3413 sitemap.xml: 1533906435 yoast-snippetpreview.json: 1480321830 diff --git a/config/sites/snowzone/config.yaml b/config/sites/snowzone/config.yaml index 9471f7a..774a9ff 100644 --- a/config/sites/snowzone/config.yaml +++ b/config/sites/snowzone/config.yaml @@ -50,7 +50,6 @@ routeEnhancers: /: 0 /json: 1701 /html: 1702 - /form: 1704 /captcha: 3413 sitemap.xml: 1533906435 yoast-snippetpreview.json: 1480321830 diff --git a/config/sites/unichamp/config.yaml b/config/sites/unichamp/config.yaml index 52469b7..8c6b65d 100644 --- a/config/sites/unichamp/config.yaml +++ b/config/sites/unichamp/config.yaml @@ -50,7 +50,6 @@ routeEnhancers: /: 0 /json: 1701 /html: 1702 - /form: 1704 /captcha: 3413 sitemap.xml: 1533906435 yoast-snippetpreview.json: 1480321830 diff --git a/packages/ep_theme/Configuration/TypoScript/Page/Form.typoscript b/packages/ep_theme/Configuration/TypoScript/Page/Form.typoscript deleted file mode 100644 index 4e16ec1..0000000 --- a/packages/ep_theme/Configuration/TypoScript/Page/Form.typoscript +++ /dev/null @@ -1,29 +0,0 @@ -# The forms of a page without the page around them (/path/form). The static pages of the hybrid -# setup load this into a placeholder with htmx, and the forms post back to it (see -# FormSetup.yaml): the page URL itself is a static file that never reaches TYPO3. -# Every form page has a single form, wherever it sits (a grid or container counts as well). - -tx_eptheme_form = PAGE -tx_eptheme_form { - typeNum = 1704 - config { - disableAllHeaderCode = 1 - disablePrefixComment = 1 - additionalHeaders.10.header = Content-Type: text/html; charset=utf-8 - additionalHeaders.20.header = X-Robots-Tag: noindex, nofollow - admPanel = 0 - debug = 0 - } - - 10 = CONTENT - 10 { - table = tt_content - select { - where = {#CType} = 'form_formframework' - orderBy = sorting - } - # Only the plugin (Templates/Form/Render.html, a .form-island): header and frame stay on - # the static page - renderObj =< tt_content.form_formframework.20 - } -} diff --git a/packages/ep_theme/Configuration/Yaml/FormSetup.yaml b/packages/ep_theme/Configuration/Yaml/FormSetup.yaml index 1577e2e..2031a4c 100644 --- a/packages/ep_theme/Configuration/Yaml/FormSetup.yaml +++ b/packages/ep_theme/Configuration/Yaml/FormSetup.yaml @@ -19,10 +19,6 @@ TYPO3: # Every form has a captcha honeypot: enable: false - # Forms post to the form page type (tx_eptheme_form, /form): on the static - # pages of the hybrid setup the page URL itself never reaches TYPO3 - additionalParams: - type: 1704 finishersDefinition: BpnApiFinisher: diff --git a/packages/ep_theme/Resources/Private/Templates/Form/Form.html b/packages/ep_theme/Resources/Private/Templates/Form/Form.html index 4f44172..cb4920d 100644 --- a/packages/ep_theme/Resources/Private/Templates/Form/Form.html +++ b/packages/ep_theme/Resources/Private/Templates/Form/Form.html @@ -13,11 +13,11 @@ additionalAttributes="{formvh:translateElementProperty(element: form, property: 'fluidAdditionalAttributes')}" data="{'controller': 'form-debounce', 'action': 'form-debounce#debounce', 'form-debounce-disabled-class': 'cursor-not-allowed'}" hx-boost="true" - hx-target="closest .form-island" - hx-select=".form-island" + hx-target="#form-island-{form.identifier}" + hx-select="#form-island-{form.identifier}" hx-swap="outerHTML" hx-push-url="false" - hx-indicator="closest .form-island" + hx-indicator="#form-island-{form.identifier}" >
diff --git a/packages/ep_theme/Resources/Private/Templates/Form/Render.html b/packages/ep_theme/Resources/Private/Templates/Form/Render.html index a249332..d9e1cf8 100644 --- a/packages/ep_theme/Resources/Private/Templates/Form/Render.html +++ b/packages/ep_theme/Resources/Private/Templates/Form/Render.html @@ -1,5 +1,5 @@ - +