feat: forms on TYPO3 13, loaded into the static pages with htmx
The static export replaced every EXT:form form with a contact notice. The forms are back, rendered by TYPO3 13 and embedded in the static pages: - Page type 1704 (/<page>/form) renders only the form plugin of a page, inside a .form-island element. Every form posts to that URL (renderingOptions.additionalParams), because on www the page URL is a static file that never reaches TYPO3. htmx swaps the island in place: validation errors, multi-step pages and confirmations. A redirect to an htmx request becomes HX-Redirect (HtmxRedirectMiddleware), so Redirect finishers send the browser to the thank-you page. - While a request runs, an overlay with a spinner (as in MyE&P) covers the form. Styled inside the island: the static pages load the CSS of the TYPO3 10 export. - The bw_captcha image comes from /<page>/captcha for the same reason. Both suffixes are in the PageType enhancer of every site with forms (semesterende gets one with default '' to keep its URLs). - Ported from TYPO3 10: form setup, templates and partials, the MyE&P address finisher, the job application finisher with the MyE&P Team API client (epTeamApi* in secrets.php), the page URL/referrer finisher with ReferrerMiddleware (?ref=), the e-mail layout without the system footer, bw_captcha 5 and form_element_linked_checkbox 6. The address check forms are dropped. - German language packs (EXT:form messages): availableLanguages = de, fetched on every deploy (typo3:language:update). - The checkbox partials passed null to VHS' substring, which PHP 8.5 reports as deprecated. - DDEV no longer turns deprecations into exceptions, matching production: EXT:form's RenderFormValueViewHelper uses null as an array offset for empty optional fields (core bug, also in 13.4.37). The static pages get their placeholders from the exporter in EP/website, see .ddev/plans/static-export-form-islands.patch (local only). Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
59e4a2d49b
commit
925e24397b
54 files changed
+2500
-3
No files matched your search
@@ -0,0 +1,28 @@
|
||||
<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">
|
||||
<formvh:renderRenderable renderable="{form}">
|
||||
<formvh:form
|
||||
object="{form}"
|
||||
action="{form.renderingOptions.controllerAction}"
|
||||
method="{form.renderingOptions.httpMethod}"
|
||||
id="{form.identifier}"
|
||||
section="{form.identifier}"
|
||||
enctype="{form.renderingOptions.httpEnctype}"
|
||||
addQueryString="{form.renderingOptions.addQueryString}"
|
||||
argumentsToBeExcludedFromQueryString="{form.renderingOptions.argumentsToBeExcludedFromQueryString}"
|
||||
additionalParams="{form.renderingOptions.additionalParams}"
|
||||
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-swap="outerHTML"
|
||||
hx-push-url="false"
|
||||
hx-indicator="closest .form-island"
|
||||
>
|
||||
<f:render partial="{form.currentPage.templateName}" arguments="{page: form.currentPage}" />
|
||||
<div class="actions">
|
||||
<f:render partial="Form/Navigation" arguments="{form: form}" />
|
||||
</div>
|
||||
</formvh:form>
|
||||
</formvh:renderRenderable>
|
||||
</html>
|
||||
@@ -0,0 +1,25 @@
|
||||
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
|
||||
<f:comment>
|
||||
The forms of a page as the form page type (/path/form) returns them: htmx swaps this element 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.
|
||||
</f:comment>
|
||||
<div class="form-island">
|
||||
{forms -> f:format.raw()}
|
||||
<div class="form-island__loading" aria-hidden="true">
|
||||
<f:render partial="Form/Spinner" arguments="{class: 'form-island__spinner'}" />
|
||||
</div>
|
||||
<style>
|
||||
.form-island { position: relative; }
|
||||
.form-island__loading { position: absolute; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; background: rgb(255 255 255 / .7); visibility: hidden; opacity: 0; transition: opacity .15s, visibility .15s; }
|
||||
.form-island.htmx-request .form-island__loading { visibility: visible; opacity: 1; }
|
||||
.form-island__spinner { width: 6rem; height: 6rem; color: rgb(24 82 123); }
|
||||
.sbw .form-island__spinner { color: rgb(233 28 38); }
|
||||
.snz .form-island__spinner { color: rgb(249 195 61); }
|
||||
.suz .form-island__spinner { color: rgb(130 195 198); }
|
||||
.uch .form-island__spinner { color: rgb(25 163 220); }
|
||||
.ser .form-island__spinner { color: rgb(222 44 27); }
|
||||
</style>
|
||||
</div>
|
||||
</html>
|
||||
@@ -0,0 +1,10 @@
|
||||
<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:flashMessages />
|
||||
<f:if condition="{formConfiguration}">
|
||||
<div class="py-8">
|
||||
<formvh:render overrideConfiguration="{formConfiguration}" />
|
||||
</div>
|
||||
</f:if>
|
||||
|
||||
</html>
|
||||
Reference in new issue
Block a user