Bug #87538
closedCustom form template in yaml definition does not work
0%
Description
I have set a custom template path in the global yaml configuration, but it always uses the standard template. Here is my setup:
TYPO3:
CMS:
Form:
persistenceManager:
allowedFileMounts:
100: 1:/asf/
110: 1:/sdgesg/
120: 1:/rwhgwrth/
130: 1:/wrthwrth/
140: 1:/oertherthert/
150: 1:/ertherth/
160: 1:/terjertjetrj/
170: 1:/oetherth/
allowSaveToExtensionPaths: false
allowDeleteFromExtensionPaths: false
#allowedExtensionPaths:
#10: EXT:example/Resources/Private/Forms/
formManager:
dynamicRequireJsModules:
app: 'TYPO3/CMS/Form/Backend/FormManager'
viewModel: 'TYPO3/CMS/Form/Backend/FormManager/ViewModel'
stylesheets:
100: 'EXT:form/Resources/Public/Css/form.css'
translationFile: 'EXT:form/Resources/Private/Language/Database.xlf'
javaScriptTranslationFile: 'EXT:form/Resources/Private/Language/locallang_formManager_javascript.xlf'
selectablePrototypesConfiguration:
100:
identifier: 'standard'
label: 'formManager.selectablePrototypesConfiguration.standard.label'
newFormTemplates:
500:
templatePath: 'EXT:tezhetrzherzth/EventForm.yaml'
label: 'Veranstaltungsformular'
prototypes:
standard:
formElementsDefinition:
Form:
renderingOptions:
templateRootPaths:
100: 'assets/templates/ext/formframework/Templates/'
Updated by Bernhard Eckl almost 6 years ago
TYPO3: CMS: Form: persistenceManager: allowedFileMounts: 100: 1:/sadf/ 110: 1:/asdf 120: 1:/asdf/ 130: 1:/asdfas/ 140: 1:/asdfasf 150: 1:/ergvqerw/ 160: 1:/refqerfn/ 170: 1:/qfewfqwe/ allowSaveToExtensionPaths: false allowDeleteFromExtensionPaths: false #allowedExtensionPaths: #10: EXT:example/Resources/Private/Forms/ formManager: dynamicRequireJsModules: app: 'TYPO3/CMS/Form/Backend/FormManager' viewModel: 'TYPO3/CMS/Form/Backend/FormManager/ViewModel' stylesheets: 100: 'EXT:form/Resources/Public/Css/form.css' translationFile: 'EXT:form/Resources/Private/Language/Database.xlf' javaScriptTranslationFile: 'EXT:form/Resources/Private/Language/locallang_formManager_javascript.xlf' selectablePrototypesConfiguration: 100: identifier: 'standard' label: 'formManager.selectablePrototypesConfiguration.standard.label' newFormTemplates: 500: templatePath: 'EXT:dgwerg/Resources/Private/Yaml/NewForms/EventForm.yaml' label: 'Veranstaltungsformular' prototypes: standard: formElementsDefinition: Form: renderingOptions: templateRootPaths: 100: 'assets/templates/ext/formframework/Templates/'
Updated by Ralf Zimmermann almost 6 years ago
Please use something like
100: 'EXT:assets/templates/ext/formframework/Templates/'(https://docs.typo3.org/typo3cms/extensions/form/Config/proto/formElements/formElementTypes/Form.html#renderingoptions-templaterootpaths)
Updated by Bernhard Eckl almost 6 years ago
My template is not in an extension, that‘s why I have no path with ext:.
But nevertheless, I also tried EXT:extname/Resources/Private/formframework/Templates/, no luck.
(In Templates/ I have Finishers/Confirmation/Confirmation.html)
Updated by Bernhard Eckl almost 6 years ago
Here is the solution (finishers is different):
prototypes: standard: finishersDefinition: Confirmation: implementationClassName: 'TYPO3\CMS\Form\Domain\Finishers\ConfirmationFinisher' options: #message: '' #variables: templateName: 'Confirmation' templateRootPaths: 100: 'path/Resources/Private/formframework/Templates/Finishers/Confirmation/'
I think form ext needs a documentation update.
Updated by Ralf Zimmermann almost 6 years ago
The documentation already exists https://docs.typo3.org/typo3cms/extensions/form/Config/proto/finishersDefinition/finishers/Confirmation.html#options-templaterootpaths.
Your initial question refers to the form element templates which can be configured with
TYPO3.CMS.Form.prototypes.<prototypeIdentifier>.formElementsDefinition.Form.renderingOptions.templateRootPaths(https://docs.typo3.org/typo3cms/extensions/form/Config/proto/formElements/formElementTypes/Form.html#renderingoptions-templaterootpaths).
Finisher with templates must be configured within their options (e.g. https://docs.typo3.org/typo3cms/extensions/form/Config/proto/finishersDefinition/finishers/Confirmation.html#options-templaterootpath or https://docs.typo3.org/typo3cms/extensions/form/Config/proto/finishersDefinition/finishers/EmailToReceiver.html#options-templatepathandfilename) depending on their implementation.