Documentation · ViewHelper reference

Form / ContentViewHelper

Adds a content area to a source using Flux FlexForms

Only works to insert a single content area into your element. To insert multiple content areas, use instead a full flux:grid with your desired row and column structure; each column then becomes a content area.

Using flux:grid after this ViewHelper in the same flux:form will overwrite this ViewHelper.

Using this ViewHelper after flux:grid will cause this ViewHelper to be ignored.

Example of difference

<flux:form id="myform">
    <!-- Creates a basic Grid with one row and one column, names
         the column "mycontent" and makes Flux use this Grid -->
    <flux:content name="mycontent" />
    <!-- Additional flux:content tags are completely ignored -->
</flux:form>

<flux:form id="myform">
    <!-- Creates a full, multi-column/row Grid -->
    <flux:grid>
        <flux:grid.row>
            <flux:grid.column name="mycontentA" />
            <flux:grid.column name="mycontentB" />
        </flux:grid.row>
        <flux:grid.row>
            <flux:grid.column name="mycontentC" colspan="2" />
        </flux:grid.row>
    </flux:grid>
    <!-- No use of flux:content is possible after this point -->
</flux:form>

/

  • Tag usage example

    <flux:form.content name="NULL" label="NULL" extensionName="NULL">
    	<!-- tag content - may be ignored! -->
    </flux:form.content>
  • Inline usage example

    {flux:form.content(name: 'NULL', label: 'NULL', extensionName: 'NULL')}

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
label

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

string
name

Name of the content area, FlexForm XML-valid tag name string

string
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 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

commit 09e9782307ad5a6ed17545a2c05f78482aca97cd
Author: Claus Due <*****@namelesscoder.net>
Date:   Sat Apr 26 18:20:47 2014 +0200

    [TASK] Silently deprecate flux:form.content
    
    This ViewHelper and component is no longer necessary. In order to allow a smooth deprecation, the ViewHelper is left in place but will override the name and label of the `flux:grid.column` it is placed inside. This allows the `flux:grid.column` to be used by all subsequent parts of Flux to read content area names/labels.
    
    Unfortunate side-effect: all LLL labels currently under `flux.$formId.areas.$contentName` must be renamed to `flux.$formId.columns.$contentName`. Page column labels completely unaffected.

commit 5bcdb6de8ffdd516ef3b65228fe1a3e1a6c90054
Author: Claus Due <*****@namelesscoder.net>
Date:   Fri Jun 6 18:23:07 2014 +0200

    [FEATURE] Allow use of flux:form.content without flux:grid
    
    This change adds the ability of the `flux:form.content` ViewHelper to create a default Grid with one row and one column if `flux:form.content` is used outside of `flux:grid`. This also means `flux:form.content` is no longer deprecated but now serves only this purpose instead of its original purpose.
    
    Caveats:
    
    * Adding a `flux:grid` after a `flux:form.content` (obviously requiring the `flux:form.content` to be **outside** `flux:grid` in the first place) will **overwrite the first grid and/or create a second grid which is not automatically fetched from the template but must manually be fetched in a custom Provider class**.
    * Using more than one `flux:form.content` in sequence when outside of `flux:grid` will be ignored; only the first occurrence is used.
    
    In other words, use of this feature should be reserved for cases when you only need one content area - for example in custom container elements like the Bootstrap Well element.

commit d32642581c845570da8f7262b8ab22410dba4b01
Author: Claus Due <*****@namelesscoder.net>
Date:   Fri Jun 6 18:34:55 2014 +0200

    [DOC] Document difference of use in Form / Content ViewHelper

commit 831b4a4161a34e79c001fa99d6760a0821956590
Author: G. Bodenschatz <*****@46halbe.de>
Date:   Sat Oct 25 17:21:47 2014 +0200

    [DOC] Change inline description of label argument