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
@@ -8,5 +8,25 @@ return [
|
||||
'typo3/cms-frontend/page-resolver',
|
||||
],
|
||||
],
|
||||
'ep/referrer' => [
|
||||
'target' => \EP\EpTheme\Middleware\ReferrerMiddleware::class,
|
||||
'after' => [
|
||||
'typo3/cms-frontend/authentication',
|
||||
],
|
||||
'before' => [
|
||||
'typo3/cms-frontend/page-resolver',
|
||||
],
|
||||
],
|
||||
// Outermost of the frontend stack after the site is known, so it also sees redirects
|
||||
// that core middlewares or exceptions (PropagateResponseException) produce
|
||||
'ep/htmx-redirect' => [
|
||||
'target' => \EP\EpTheme\Middleware\HtmxRedirectMiddleware::class,
|
||||
'after' => [
|
||||
'typo3/cms-frontend/site',
|
||||
],
|
||||
'before' => [
|
||||
'typo3/cms-frontend/authentication',
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
@@ -7,3 +7,9 @@ services:
|
||||
EP\EpTheme\:
|
||||
resource: '../Classes/*'
|
||||
exclude: '../Classes/Domain/Model/*'
|
||||
|
||||
# Form finishers are created with GeneralUtility::makeInstance(), once per form submission
|
||||
EP\EpTheme\Form\:
|
||||
resource: '../Classes/Form/*'
|
||||
public: true
|
||||
shared: false
|
||||
@@ -0,0 +1,20 @@
|
||||
@import 'EXT:form/Configuration/TypoScript/setup.typoscript'
|
||||
@import 'EXT:form_element_linked_checkbox/Configuration/TypoScript/setup.typoscript'
|
||||
@import 'EXT:bw_captcha/Configuration/TypoScript/setup.typoscript'
|
||||
|
||||
plugin.tx_form.view {
|
||||
templateRootPaths.10 = EXT:ep_theme/Resources/Private/Templates/Form/
|
||||
}
|
||||
|
||||
plugin.tx_form.settings.yamlConfigurations {
|
||||
1630994710 = EXT:ep_theme/Configuration/Yaml/FormSetup.yaml
|
||||
}
|
||||
|
||||
plugin.tx_bwcaptcha.settings {
|
||||
charset = abcdefghjkmnpqrtuvwxy34679
|
||||
length = 4
|
||||
width = 220
|
||||
height = 60
|
||||
# The partial has its own reload button and no audio
|
||||
audioButton = 0
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
# 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 = FLUIDTEMPLATE
|
||||
10 {
|
||||
templateName = Island
|
||||
templateRootPaths.0 = EXT:ep_theme/Resources/Private/Templates/Form/
|
||||
partialRootPaths.0 = EXT:ep_theme/Resources/Private/Partials/
|
||||
|
||||
variables.forms = CONTENT
|
||||
variables.forms {
|
||||
table = tt_content
|
||||
select {
|
||||
where = {#CType} = 'form_formframework'
|
||||
orderBy = sorting
|
||||
}
|
||||
# Only the plugin (Templates/Form/Render.html): header and frame stay on the static page
|
||||
renderObj =< tt_content.form_formframework.20
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
TYPO3:
|
||||
CMS:
|
||||
Form:
|
||||
persistenceManager:
|
||||
allowedExtensionPaths:
|
||||
10: EXT:ep_theme/Resources/Private/Forms/
|
||||
|
||||
prototypes:
|
||||
standard:
|
||||
formElementsDefinition:
|
||||
Form:
|
||||
renderingOptions:
|
||||
templateRootPaths:
|
||||
1505042810: 'EXT:ep_theme/Resources/Private/Templates/Form/'
|
||||
partialRootPaths:
|
||||
1623227657: 'EXT:ep_theme/Resources/Private/Partials/Form/'
|
||||
layoutRootPaths:
|
||||
1505042810: 'EXT:ep_theme/Resources/Private/Layouts/Form/'
|
||||
# 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:
|
||||
implementationClassName: 'EP\EpTheme\Form\BpnApiFinisher'
|
||||
formEditor:
|
||||
label: 'BusPro Finisher'
|
||||
options:
|
||||
identifier: 'BpnApiFinisher'
|
||||
mapping: 'lastName:text-1,firstName:text-2,gender:singleselect-1,email:email-1,phone:telephone-1'
|
||||
ApplicationApiFinisher:
|
||||
implementationClassName: 'EP\EpTheme\Form\ApplicationApiFinisher'
|
||||
formEditor:
|
||||
label: 'Application Finisher'
|
||||
options:
|
||||
identifier: 'ApplicationApiFinisher'
|
||||
mapping: 'firstName:text-1,lastName:text-2,email:email-1,phone:telephone-1'
|
||||
exclude: 'captcha,privacypolicyaccepted'
|
||||
AddReferrerFinisher:
|
||||
implementationClassName: 'EP\EpTheme\Form\AddReferrerFinisher'
|
||||
formEditor:
|
||||
label: 'Referrer Finisher'
|
||||
options:
|
||||
identifier: 'AddReferrerFinisher'
|
||||
|
||||
contactform:
|
||||
__inheritances:
|
||||
10: 'TYPO3.CMS.Form.prototypes.standard'
|
||||
|
||||
applicationform:
|
||||
__inheritances:
|
||||
10: 'TYPO3.CMS.Form.prototypes.standard'
|
||||
Reference in new issue
Block a user