5.3.2 Migration to Flux 7.1

Flux 7.1 is a minor upgrade from Flux 7.0, but upgrading from lower versions of Flux of course requires that you also perform the steps described in the Migration to Flux 7.0 chapter. You can perform both steps in one go.

Changes in Flux 7.1

The most important change is the consolidated Grid feature. The use of Grids has been changed to make the API you use, the exact same API regardless of how the template is used.

Before

In earlier versions of Flux you would use flux:form.content (or in even earlier versions, flux:flexform.content) inside flux:grid.column (or in earlier versions, flux:flexform.grid.column) when making a template that gets used in a content element. This extra ViewHelper is no longer necessary.

After

In Flux 7.1 you define Grids using flux:grid, flux:grid.row and flux:grid.column only. You set the name or colPos attribute on flux:grid.column to indicate the name or column index position - which of the two you should use depends on the feature that uses the Grid. For example, the page column rendering in TYPO3 requires the use of colPos where other features most likely will use the name attribute.

The old flux:form.content ViewHelper has been redesigned from the earlier function. In Flux 7.1, using the ViewHelper inside a column will break the Grid. This is because the ViewHelper now is the shorthand form of creating a single grid with one row with one column inside it. To illustrate:

<flux:form id="myForm">
    ...
</flux:form>
<flux:grid>
    <flux:grid.row>
        <flux:grid.column name="content" colPos="0" />
    </flux:grid.row>
</flux:grid>

Can now be shortened to:

<flux:form id="myForm">
    ...
</flux:form>
<flux:form.content />

However: as soon as you require additional columns or require another name than content or a different column index value than 0, you still have to "expand" the ViewHelper to a standard grid, row and column structure.

Form-level options

Some options which were previously explicit attributes for flux:form have been deprecated and moved to the options array. To illustrate all of these changes in a single example:

<flux:form id="myForm" wizardTab="My tab" icon="EXT:myext/ext_icon.png">
    ...
</flux:form>

OR:

$form = Form::create();
$form->setIcon('EXT:myext/ext_icon.png');
$form->setWizardTab('My tab');

Must now be written as:

<flux:form id="myForm" options="{group: 'My tab', icon: 'EXT:myext/ext_icon.png'}">
    ...
</flux:form>

OR:

$form = Form::create();
$form->setOption(Form::OPTION_ICON, 'EXT:myext/ext_icon.png');
$form->setOption(Form::OPTION_GROUP, 'My tab');

The reason for this change is to allow any number of options to be added from any feature - and for example, we use this in fluidpages and fluidcontent to define allowed content types and allowed fluidcontent types inside a column defined by flux:grid.column.

You can read more about these column-related options in the chapter about using the Grid.

Jump to...