Documentation · ViewHelper reference

Form / VariableViewHelper

Sets an option in the Form instance /

  • Tag usage example

    <flux:form.variable name="NULL" value="[mixed]">
    	<!-- tag content - may be ignored! -->
    </flux:form.variable>
  • Inline usage example

    {flux:form.variable(name: 'NULL', value: [mixed])}

Arguments

Argument Description Type
name

Name of the option - valid values and their behaviours depend entirely on the consumer that will handle the Form instance

string
value

Value of the option

mixed
Required attribute

Revision history

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