Responsive Icon für Tablet
Icon für Tablet
Icon für Smartphone
Icon für Smartphone

Silke Bötzel
Dipl. Informatikerin

Auf dem Spiekstück 5
58239 Schwerte

T (0 23 04) 69 74 14

Form Templates in eigener Extension ablegen

<?php
defined('TYPO3_MODE') or die('Access denied.');

/***************
 * Register custom EXT:form configuration
 */
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScriptSetup(trim('
    module.tx_form {
        settings {
            yamlConfigurations {
                200 = EXT:myext/Configuration/Form/CustomFormSetup.yaml
            }
        }
    }
    plugin.tx_form {
        settings {
            yamlConfigurations {
                200 = EXT:myext/Configuration/Form/CustomFormSetup.yaml
            }
        }
    }
'));
/typo3conf/ext/myext/ext_localconf.php
TYPO3:
    CMS:
        Form:
            persistenceManager:
                allowedExtensionPaths:
                    200: EXT:myext/Resources/Private/Forms/

evtl. noch ergänzen:
                allowSaveToExtensionPaths: true
                allowDeleteFromExtensionPaths: true
/typo3conf/ext/myext/Configuration/Form/CustomFormSetup.yaml
type: Form
identifier: contactform
label: Contact Form
prototypeName: standard

finishers:
    -
        identifier: EmailToReceiver
        options:
            subject: '{subject}'
            recipientAddress: ''
            recipientName: ''
            senderAddress: '{email}'
            senderName: '{fullname}'
            replyToAddress: '{email}'
            carbonCopyAddress: ''
            blindCarbonCopyAddress: ''
            format: html
            templateName: '{@format}.html'
            templateRootPaths:
                20: 'EXT:myext/Resources/Private/Forms/Emails/Receiver/'
            attachUploads: true
    -
        identifier: Redirect
        options:
            pageUid: ''
            additionalParameters: ''

renderables:
    -
        type: Page
        identifier: form
        label: ''
        renderables:
            -
                properties:
                    text: '* Mandatory fields'
                type: StaticText
                identifier: mandatory
                label: 'Your personal data'
            -
                type: GridRow
                identifier: gridrow
                label: ''
                renderables:
                    -
                        type: Fieldset
                        identifier: fieldset-left
                        label: ''
                        properties:
                            gridColumnClassAutoConfiguration:
                                viewPorts:
                                    xs: { numbersOfColumnsToUse: '12' }
                                    sm: { numbersOfColumnsToUse: '6' }
                                    md: { numbersOfColumnsToUse: '6' }
                                    lg: { numbersOfColumnsToUse: '6' }
                        renderables:
                            -
                                type: Text
                                identifier: fullname
                                label: 'Full name and surname'
                                properties:
                                    fluidAdditionalAttributes:
                                        placeholder: 'Full name and surname'
                                        required: required
                                validators:
                                    - { identifier: NotEmpty }
                            -
                                type: Text
                                identifier: company
                                label: 'Company'
                                properties:
                                    fluidAdditionalAttributes:
                                        placeholder: 'Company'
                            -
                                type: Text
                                identifier: email
                                label: 'Email'
                                properties:
                                    fluidAdditionalAttributes:
                                        placeholder: 'Email'
                                        required: required
                                validators:
                                    - { identifier: NotEmpty }
                                    - { identifier: EmailAddress }
                    -
                        type: Fieldset
                        identifier: fieldset-right
                        label: ''
                        properties:
                            gridColumnClassAutoConfiguration:
                                viewPorts:
                                    xs: { numbersOfColumnsToUse: '12' }
                                    sm: { numbersOfColumnsToUse: '6' }
                                    md: { numbersOfColumnsToUse: '6' }
                                    lg: { numbersOfColumnsToUse: '6' }
                        renderables:
                            -
                                type: Text
                                identifier: subject
                                label: 'Subject'
                                properties:
                                    fluidAdditionalAttributes:
                                        placeholder: 'Subject'
                                        required: required
                                validators:
                                    - { identifier: NotEmpty }
                            -
                                type: Textarea
                                identifier: message
                                label: 'Message'
                                properties:
                                    fluidAdditionalAttributes:
                                        placeholder: 'Message'
                                        required: required
                                validators:
                                    - { identifier: NotEmpty }
/typo3conf/ext/myext/Resources/Private/Forms/Contact.form.yaml