Skip to content

make TYPO3 ce default variables available in templates #28

@medarob

Description

@medarob

Use Case:
You have multiple opt-in forms and based on the form, the validation text should be different/customized.

So, I wanted to use the layout field {data.layout} in the Validation.html template to change the text and created another option for the {layout} field.

        <f:if condition="{success}">
            <f:then>
                <f:if condition="{data.layout} == 20">
                    <f:then>
                        <f:comment><!-- customizations --></f:comment>
                        <h2>Custom Headline</h2>
                        <p>Custom text</p>
                    </f:then>
                    <f:else>
                        <f:comment><!-- Default --></f:comment>
                        <h2><f:translate key="LLL:EXT:form_double_opt_in/Resources/Private/Language/locallang.xlf:text.success.title" /></h2>
                        <p><f:translate key="LLL:EXT:form_double_opt_in/Resources/Private/Language/locallang.xlf:text.success" /></p>
                    </f:else>
                </f:if>
            </f:then>
            <f:else>
                <h2><f:translate key="LLL:EXT:form_double_opt_in/Resources/Private/Language/locallang.xlf:text.error.title" /></h2>
                <p><f:translate key="LLL:EXT:form_double_opt_in/Resources/Private/Language/locallang.xlf:text.error" /></p>
            </f:else>
        </f:if>

But it seems that {data} is not available in the template

array(3 items)
   settings => array(empty)
   success => FALSE
   validated => FALSE

Is it possible to make {data} available in this context?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions