View

To be able to correctly use all features during a form's HTML integration, you will have to use some TypoScript parameters.

Properties

Property Title
classes Dynamic HTML classes list.
layouts Usable layouts list.
layoutRootPaths Valid paths for layouts.
partialRootPaths Valid paths for partials.

Dynamic classes

Property

classes

Required?

No

Description

Contains the list of usable classes for the ViewHelper “Class”.

The first level of this configuration must be a key among these two:

  • valid: contains all classes which are activated when the field is valid.
  • errors: contains all classes which are activated when the field is not valid.

Example:

config.tx_formz.view {
    valid {
        has-success = has-success
    }
    errors {
        has-error = has-error
    }
}

Layouts

Property

layouts

Required?

No

Description

Contains the list of usable layouts for the property layout of the ViewHelper “Field”.

Layouts are divided in groups, then in a list of layouts for each one of these groups.

In each group, two properties must be filled:

  • templateFile: path to the template which will be used for every layout of this group.
  • items: list of layouts for this group: the key of every layout will be its identifier.
    • templateFile: path to the template which will be used for this layout (overrides the value of the default one).
    • layout: relative path to the layout (must be available in the paths defined in the property “layoutRootPaths”).

Example:

config.tx_formz.view.layouts {
    application1 {
        templateFile = EXT:extension/Resources/Private/Templates/Application1/Default.html
        items {
            one-column.layout = Application1/OneColumn
            two-columns.layout = Application1/TwoColumns
        }
    }

    application2 {
        templateFile = EXT:extension/Resources/Private/Templates/Application2/Default.html
        items {
            one-column.layout = Application2/OneColumn

            very-special-layout {
                templateFile = EXT:extension/Resources/Private/Templates/Application2/Special.html
                layout = Application2/TwoColumns
            }
        }
    }
}

Note

FormZ offers by default layouts for the CSS frameworks Twitter Bootstrap and Foundation. Read the chapter “@todo” for more information.

Layout root paths

Property

layoutRootPaths

Required?

No

Description

Contains the list of paths handled by the layouts.

Note

At index 10 is the path to FormZ layouts.

Example:

config.tx_formz.view {
    layoutRootPaths {
        20 = EXT:my_extension/Resources/Private/Layouts/Forms/
    }
}

Partial root paths

Property

partialRootPaths

Required?

No

Description

Contains the list of paths handled by the partials.

Note

At index 10 is the path to FormZ partials.

Example:

config.tx_formz.view {
    partialRootPaths {
        20 = EXT:my_extension/Resources/Private/Partials/Forms/
    }
}