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-<form identifier> (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 <[email protected]>
This commit is contained in:
1 parent
114a45aed3
commit
386d89a1e0
10 files changed
+4
-43
No files matched your search
@@ -282,7 +282,6 @@ routeEnhancers:
|
||||
/: 0
|
||||
/json: 1701
|
||||
/html: 1702
|
||||
/form: 1704
|
||||
/captcha: 3413
|
||||
.json: 1803
|
||||
.ical: 1710
|
||||
|
||||
@@ -85,7 +85,6 @@ routeEnhancers:
|
||||
default: ''
|
||||
index: ''
|
||||
map:
|
||||
/form: 1704
|
||||
/captcha: 3413
|
||||
routes:
|
||||
-
|
||||
|
||||
@@ -66,7 +66,6 @@ routeEnhancers:
|
||||
/: 0
|
||||
/json: 1701
|
||||
/html: 1702
|
||||
/form: 1704
|
||||
/captcha: 3413
|
||||
sitemap.xml: 1533906435
|
||||
yoast-snippetpreview.json: 1480321830
|
||||
|
||||
@@ -50,7 +50,6 @@ routeEnhancers:
|
||||
/: 0
|
||||
/json: 1701
|
||||
/html: 1702
|
||||
/form: 1704
|
||||
/captcha: 3413
|
||||
sitemap.xml: 1533906435
|
||||
yoast-snippetpreview.json: 1480321830
|
||||
|
||||
@@ -50,7 +50,6 @@ routeEnhancers:
|
||||
/: 0
|
||||
/json: 1701
|
||||
/html: 1702
|
||||
/form: 1704
|
||||
/captcha: 3413
|
||||
sitemap.xml: 1533906435
|
||||
yoast-snippetpreview.json: 1480321830
|
||||
|
||||
@@ -50,7 +50,6 @@ routeEnhancers:
|
||||
/: 0
|
||||
/json: 1701
|
||||
/html: 1702
|
||||
/form: 1704
|
||||
/captcha: 3413
|
||||
sitemap.xml: 1533906435
|
||||
yoast-snippetpreview.json: 1480321830
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -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:
|
||||
|
||||
@@ -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}"
|
||||
>
|
||||
<f:render partial="{form.currentPage.templateName}" arguments="{page: form.currentPage}" />
|
||||
<div class="actions">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" xmlns:formvh="http://typo3.org/ns/TYPO3/CMS/Form/ViewHelpers" data-namespace-typo3-fluid="true">
|
||||
<f:render partial="Form/Island" contentAs="content">
|
||||
<f:render partial="Form/Island" arguments="{id: 'form-island-{formConfiguration.identifier}'}" contentAs="content">
|
||||
<f:flashMessages />
|
||||
<f:if condition="{formConfiguration}">
|
||||
<div class="py-8">
|
||||
|
||||
Reference in new issue
Block a user