Documentation · ViewHelper reference

Grid / ColumnViewHelper

Flexform Grid Column ViewHelper

Used inside <flux:grid.row> tags.

Use the name attribute for grids in content elements, and the colPos attribute for grids in pages templates.

See <flux:grid> for an example.

Limit allowed elements

It is possible to limit the elements allowed in the column by setting the allowedContentTypes variable:

<flux:grid.column name="elements">
    <flux:form.variable name="allowedContentTypes" value="text,shortcut"/>
</flux:grid.column>

The value is a comma-separated list of content type IDs; they can be found in tt_content.CType column.

Limit allowed fluid content elements

It is also possible to limit the allowed fluid content elements:

<flux:grid.column name="elements">
    <flux:form.variable name="allowedContentTypes" value="fluidcontent_content"/>
    <flux:form.variable name="Fluidcontent"
        value="{allowedContentTypes: 'Vendor.Extension:ContentElement.html'}"/>
</flux:grid.column>

/

  • Tag usage example

    <flux:grid.column name="'column'" label="NULL" colPos="123" colspan="123" rowspan="123" style="NULL" variables="{foo: 'bar'}" extensionName="NULL">
    	<!-- tag content - may be ignored! -->
    </flux:grid.column>
  • Inline usage example

    {flux:grid.column(name: ''column'', label: 'NULL', colPos: 123, colspan: 123, rowspan: 123, style: 'NULL', variables: {foo: 'bar'}, extensionName: 'NULL')}

Arguments

Argument Description Type
colPos

Page column number; use only when creating root page content columns. Container elements use "name" instead.

integer
colspan

Column span

integer
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
label

Optional column label

string
name

Identifies your column in generated configuration; also used as target ID when column is inside a container content element. Page-level content columns use "colPos" instead.

string
rowspan

Row span

integer
style

Inline style to add when rendering the column

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. Can also be set and/or overridden in tag content using <flux:form.variable />

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!

commit 335af51ddd0e22b8a73c4c25cc867f912f6bb7a1
Author: Claus Due <*****@namelesscoder.net>
Date:   Mon Jan 27 01:17:35 2014 +0100

    [FEATURE] White/blacklisting allowed CTypes in Column and Area
    
    Limits possible selections in the new content element wizard based on parameters defined in the Column or Area (or both) into which content is being inserted.
    
    ## Usage examples
    
    In a content/plugin template:
    
    ```xml
    <flux:grid.row>
    	<flux:grid.column>
    		<flux:form.content name="content">
    			<flux:form.variable name="allowedContentTypes" value="text,textpic" />
    		</flux:form.content>
    	</flux:grid.column>
    </flux:grid.row>
    ```
    
    In a page template:
    
    ```xml
    <flux:grid.row>
    	<flux:grid.column colPos="1">
    		<flux:form.variable name="allowedContentTypes" value="text,textpic" />
    	</flux:grid.column>
    </flux:grid.row>
    ```
    
    Alternative syntax:
    
    ```xml
    <flux:grid.row>
    	<flux:grid.column colPos="1" variables="{allowedContentTypes: 'text,textpic'}" />
    </flux:grid.row>
    ```
    
    Using PHP (Flux Form Components):
    
    ```php
    $grid = \FluidTYPO3\Flux\Grid::create();
    $row = $grid->createContainer('Row');
    $column = $row->createContainer('Column');
    $column->setColumnPosition(1)
    	->setVariable('allowedContentTypes', 'text,image');
    ```
    
    To blacklist, use `deniedContentTypes` instead of `allowedContentTypes` as variable name. Both can be used together: first, the whitelist is applied if it has any types contained, and second, the blacklist is applied to remove elements from the list of allowed types (which is either the full list or the previously whitelist-filtered version, if a whitelist was specified).
    
    Fixes: #197