Documentation · ViewHelper reference

Form / SectionViewHelper

FlexForm field section ViewHelper

Using a section to let a user add many elements

<flux:form.section name="settings.numbers" label="Telephone numbers">
    <flux:form.object name="mobile" label="Mobile">
        <flux:field.input name="number"/>
    </flux:form.object>
    <flux:form.object name="landline" label="Landline">
        <flux:field.input name="number"/>
    </flux:form.object>
</flux:form.section>

Reading section element values

<f:for each="{settings.numbers}" as="obj" key="id">
    Number #{id}:
    <f:if condition="{obj.landline}">mobile, {obj.landline.number}</f:if>
    <f:if condition="{obj.mobile}">landline, {obj.mobile.number}</f:if>
    <br/>
</f:for>

/

  • Tag usage example

    <flux:form.section name="NULL" label="NULL" variables="{foo: 'bar'}" extensionName="NULL" inherit="1" inheritEmpty="1">
    	<!-- tag content - may be ignored! -->
    </flux:form.section>
  • Inline usage example

    {flux:form.section(name: 'NULL', label: 'NULL', variables: {foo: 'bar'}, extensionName: 'NULL', inherit: 1, inheritEmpty: 1)}

Arguments

Argument Description Type
extensionName

If provided, enables overriding the extension context for this and all child nodes. The extension name is otherwise automatically detected from rendering context.

string
inherit

If TRUE, the value for this particular field is inherited - if inheritance is enabled by the ConfigurationProvider

boolean
inheritEmpty

If TRUE, allows empty values (specifically excluding the number zero!) to be inherited - if inheritance is enabled by the ConfigurationProvider

boolean
label

Label for section, can be LLL: value. Optional - if not specified, Flux tries to detect an LLL label named "flux.fluxFormId.sections.foobar" based on section name, in scope of extension rendering the form.

string
name

Name of the attribute, FlexForm XML-valid tag name string

string
variables

Freestyle variables which become assigned to the resulting Component - can then be read from that Component outside this Fluid template and in other templates using the Form object from this template

array
Required attribute

Revision history

commit 3390bd05f546bccfc9ca5cb012d291f7bdd63512
Author: Claus Due <*****@namelesscoder.net>
Date:   Mon Dec 2 23:26:43 2013 +0100

    [TASK] Rename ViewHelpers
    
    Renames:
    
    flux:flexform -> flux:form
    flux:flexform.field.* -> flux:field.*
    flux:flexform.field.wizard -> flux:wizard.*
    flux:flexform.* -> flux:form.*

commit 3878c943a6eb0924bb6db2e5ed8461580896431f
Author: Claus Due <*****@namelesscoder.net>
Date:   Tue Dec 10 01:59:34 2013 +0100

    [TASK] Update copyright and author tags
    
    Assumes "Claus Due" as author whenever no author is specified.

commit 15a009ef1015adaec1e1e05380180ff00e0fbc06
Author: Danilo Bürger <*****@hmspl.de>
Date:   Tue Dec 10 21:20:22 2013 +0100

    [TASK] Renamed flux field viewhelpers

commit b37dbbd83d210d12d1f0b2517b06818225ea3608
Author: Claus Due <*****@namelesscoder.net>
Date:   Tue Dec 17 17:30:12 2013 +0100

    [FEATURE] Storage of custom variables on FormComponents
    
    This allows a "variables" property to be used on every Form component and ViewHelper. Setting an array of variables here, makes those variables available anywhere the Form object is available.
    
    Can, for example, be used to store custom rendering instructions for the Preview section as described in #411

commit 8bf2b5beb89c7d72a41230f152d9a5a3d308ba84
Author: Claus Due <*****@namelesscoder.net>
Date:   Tue Dec 31 23:11:00 2013 +0100

    [TASK] Happy new year!