Documentation · ViewHelper reference

Field / Inline / FalViewHelper

Creates a FAL IRRE field

To get the file references, assigned with that field in a flux form, you will have to use EXT:vhs but there are two different ViewHelpers for fluidpages templates and fluidcontent elements.

Example how to get the first file reference from a fluidcontent element, for the flux field named "settings.files":

{v:content.resources.fal(field: 'settings.files')
    -> v:iterator.first()
    -> v:variable.set(name: 'settings.files')}

And now the example how to get the first file reference from a fluidpages template, for the flux field named "settings.files":

{v:page.resources.fal(field: 'settings.files')
    -> v:iterator.first()
    -> v:variable.set(name: 'settings.files')}

Usage warning

Due to TYPO3 core bug #71239, using FAL references within sections (<flux:form.section>) in content elements or within the page configuration does not work.

When choosing a file in one section element, you will see it in all sections. When choosing a file in a page configuration, it will be visible in the subpages configuration, too.

This issue will most likely not be fixed before TYPO3 8, so do not use it.

Alternatively, you could use <flux:field.file>.

Selecting and rendering an image

Selecting a single image

<flux:field.inline.fal name="settings.image" required="1" maxItems="1" minItems="1"/>

Rendering the image

{v:content.resources.fal(field: 'settings.image') -> v:iterator.first() -> v:variable.set(name: 'image')}
<f:image treatIdAsReference="1" src="{image.id}" title="{image.title}" alt="{image.alternative}"/><br/>

Rendering multiple images

<f:for each="{v:content.resources.fal(field: 'settings.image')}" as="image">
    <f:image treatIdAsReference="1" src="{image.id}" title="{image.title}" alt="{image.alternative}"/><br/>
</f:for>

/

  • Tag usage example

    <flux:field.inline.fal name="NULL" label="NULL" default="NULL" required="1" exclude="1" transform="NULL" enabled="1" requestUpdate="1" displayCond="NULL" inherit="1" inheritEmpty="1" clear="1" variables="{foo: 'bar'}" extensionName="NULL" validate="'trim'" size="123" multiple="1" minItems="123" maxItems="123" itemListStyle="NULL" selectedListStyle="NULL" renderMode="NULL" items="[mixed]" emptyOption="[mixed]" translateCsvItems="1" table="'sys_file_reference'" condition="NULL" mm="NULL" foreignField="'uid_foreign'" foreignLabel="'uid_local'" foreignSelector="'uid_local'" foreignSortby="'sorting_foreign'" foreignDefaultSortby="''" foreignTableField="'tablenames'" foreignUnique="NULL" symmetricField="''" symmetricLabel="''" symmetricSortby="''" localizationMode="'select'" localizeChildrenAtParentLocalization="1" disableMovingChildrenWithParent="1" showThumbs="1" matchFields="{foo: 'bar'}" oppositeField="''" collapseAll="1" expandSingle="1" newRecordLinkAddTitle="1" newRecordLinkPosition="'top'" useCombination="1" useSortable="1" showPossibleLocalizationRecords="1" showRemovedLocalizationRecords="1" showAllLocalizationLink="1" showSynchronizationLink="1" enabledControls="{foo: 'bar'}" headerThumbnail="{foo: 'bar'}" foreignMatchFields="{foo: 'bar'}" foreignTypes="{foo: 'bar'}" levelLinksPosition="'both'" allowedExtensions="NULL" disallowedExtensions="''" createNewRelationLinkTitle="'LLL:EXT:lang/locallang_core.xlf:cm.createNewRelation'">
    	<!-- tag content - may be ignored! -->
    </flux:field.inline.fal>
  • Inline usage example

    {flux:field.inline.fal(name: 'NULL', label: 'NULL', default: 'NULL', required: 1, exclude: 1, transform: 'NULL', enabled: 1, requestUpdate: 1, displayCond: 'NULL', inherit: 1, inheritEmpty: 1, clear: 1, variables: {foo: 'bar'}, extensionName: 'NULL', validate: ''trim'', size: 123, multiple: 1, minItems: 123, maxItems: 123, itemListStyle: 'NULL', selectedListStyle: 'NULL', renderMode: 'NULL', items: [mixed], emptyOption: [mixed], translateCsvItems: 1, table: ''sys_file_reference'', condition: 'NULL', mm: 'NULL', foreignField: ''uid_foreign'', foreignLabel: ''uid_local'', foreignSelector: ''uid_local'', foreignSortby: ''sorting_foreign'', foreignDefaultSortby: '''', foreignTableField: ''tablenames'', foreignUnique: 'NULL', symmetricField: '''', symmetricLabel: '''', symmetricSortby: '''', localizationMode: ''select'', localizeChildrenAtParentLocalization: 1, disableMovingChildrenWithParent: 1, showThumbs: 1, matchFields: {foo: 'bar'}, oppositeField: '''', collapseAll: 1, expandSingle: 1, newRecordLinkAddTitle: 1, newRecordLinkPosition: ''top'', useCombination: 1, useSortable: 1, showPossibleLocalizationRecords: 1, showRemovedLocalizationRecords: 1, showAllLocalizationLink: 1, showSynchronizationLink: 1, enabledControls: {foo: 'bar'}, headerThumbnail: {foo: 'bar'}, foreignMatchFields: {foo: 'bar'}, foreignTypes: {foo: 'bar'}, levelLinksPosition: ''both'', allowedExtensions: 'NULL', disallowedExtensions: '''', createNewRelationLinkTitle: ''LLL:EXT:lang/locallang_core.xlf:cm.createNewRelation'')}

Arguments

Argument Description Type
allowedExtensions

Allowed File Extensions .

string
clear

If TRUE, a "clear value" checkbox is displayed next to the field which when checked, completely destroys the current field value all the way down to the stored XML value

boolean
collapseAll

If true, all child records are shown as collapsed.

boolean
condition

Condition to use when selecting from "foreignTable", supports FlexForm "foregintablewhere" markers

string
createNewRelationLinkTitle

Override label of "Create new relation" button.

string
default

Default value for this attribute

string
disableMovingChildrenWithParent

Disables that child records get moved along with their parent records.

boolean
disallowedExtensions

Disallowed File Extensions .

string
displayCond

Optional "Display Condition" (TCA style) for this particular field. See: https://docs.typo3.org/typo3cms/TCAReference/Reference/Columns/Index.html#displaycond

string
emptyOption

If not-FALSE, adds one empty option/value pair to the generated selector box and tries to use this property's value (cast to string) as label.

mixed
enabled

If FALSE, disables the field in the FlexForm

boolean
enabledControls

Associative array with the keys 'info', 'new', 'dragdrop', 'sort', 'hide', delete' and 'localize'. ' . 'Set either one to TRUE or FALSE to show or hide it.

array
exclude

If TRUE, this field becomes an "exclude field" (see TYPO3 documentation about this)

boolean
expandSingle

Show only one expanded record at any time. If a new record is expanded, all others are collapsed.

boolean
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
foreignDefaultSortby

If a fieldname for foreign_sortby is defined, then this is ignored. Otherwise this is used as the "ORDER BY" statement to sort the records in the table when listed.

string
foreignField

The foreign_field is the field of the child record pointing to the parent record. This defines where to store the uid of the parent record.

string
foreignLabel

If set, it overrides the label set in TCA[foreign_table]['ctrl']['label'] for the inline-view.

string
foreignMatchFields

The fields and values of the child record which have to match. For FAL the field/key is "fieldname" and the value has to be defined.

array
foreignSelector

A selector is used to show all possible child records that could be used to create a relation with the parent record. It will be rendered as a multi-select-box. On clicking on an item inside the selector a new relation is created. The foreignselector points to a field of the foreigntable that is responsible for providing a selector-box this field on the foreigntable usually has the type "select" and also has a "foreigntable" defined.

string
foreignSortby

Field on the child record (or on the intermediate table) that stores the manual sorting information.

string
foreignTableField

The field of the child record pointing to the parent record. This defines where to store the table name of the parent record. On setting this configuration key together with foreign_field, the child record knows what its parent record is - so the child record could also be used on other parent tables.

string
foreignTypes

Overrides the "types" TCA array of the target table with this array (beware! must be specified fully in order to work!). Expects an array of arrays; indexed by type number - each array containing for example a "showitem" CSV list value of field names to be shown when inline-editing the related record.

array
foreignUnique

Field which must be uniue for all children of a parent record.

string
headerThumbnail

Associative array with header thumbnail.

array
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
itemListStyle

Overrides the default list style when maxItems > 1

string
items

Items for the selector; array / CSV / Traversable / Query supported

mixed
label

Label for the attribute, can be LLL: value. Optional - if not specified, Flux tries to detect an LLL label named "flux.fluxFormId.fields.foobar" based on field name, in scope of extension rendering the Flux form. If field is in an object, use "flux.fluxFormId.objects.objectname.foobar" where "foobar" is the name of the field.

string
levelLinksPosition

Level links position.

string
localizationMode

Set whether children can be localizable ('select') or just inherit from default language ('keep').

string
localizeChildrenAtParentLocalization

Defines whether children should be localized when the localization of the parent gets created.

boolean
matchFields

When using manyToMany you can provide an additional array of field=>value pairs that must match in the relation table

array
maxItems

Maxium allowed number of items to be selected

integer
minItems

Minimum required number of items to be selected

integer
mm

Optional name of MM table to use for record selection

string
multiple

If TRUE, allows multiple selections

boolean
name

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

string
newRecordLinkAddTitle

Add the foreign table's title to the 'Add new' link (ie. 'Add new (sometable)')

boolean
newRecordLinkPosition

Where to show 'Add new' link. Can be 'top', 'bottom', 'both' or 'none'.

string
oppositeField

Name of the opposite field related to a proper mm relation

string
renderMode

Alternative rendering mode - default is an HTML select field but you can also use fx "checkbox" - see TCA "select" field "renderType" attribute

string
requestUpdate

If TRUE, the form is force-saved and reloaded when field value changes

boolean
required

If TRUE, this attribute must be filled when editing the FCE

boolean
selectedListStyle

Overrides the default selected list style when maxItems > 1 and renderMode is default

string
showAllLocalizationLink

Show the 'localize all records' link to fetch untranslated records from the original language.

boolean
showPossibleLocalizationRecords

Show unlocalized records which are in the original language, but not yet localized.

boolean
showRemovedLocalizationRecords

Show records which were once localized but do not exist in the original language anymore.

boolean
showSynchronizationLink

Defines whether to show a 'synchronize' link to update to a 1:1 translation with the original language.

boolean
showThumbs

If TRUE, adds thumbnail display when editing in BE

boolean
size

Size of the selector box

integer
symmetricField

In case of bidirectional symmetric relations, this defines in which field on the foreign table the uid of the "other" parent is stored.

string
symmetricLabel

If set, this overrides the default label of the selected symmetric_field.

string
symmetricSortby

Works like foreignsortby, but defines the field on foreigntable where the "other" sort order is stored.

string
table

Define foreign table name to turn selector into a record selector for that table

string
transform

Set this to transform your value to this type - integer, array (for csv values), float, DateTime, Vendor\MyExt\Domain\Model\Object or ObjectStorage with type hint.

string
translateCsvItems

If TRUE, attempts to resolve a LLL label for each value provided as CSV in "items" attribute using convention for lookup "$field.option.123" if given "123" as CSV item value. Field name is determined by normal Flux field name conventions

boolean
useCombination

For use on bidirectional relations using an intermediary table. In combinations, it's possible to edit ' . 'attributes and the related child record.

boolean
useSortable

Allow manual sorting of records.

boolean
validate

FlexForm-type validation configuration for this input

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 15a009ef1015adaec1e1e05380180ff00e0fbc06
Author: Danilo Bürger <*****@hmspl.de>
Date:   Tue Dec 10 21:20:22 2013 +0100

    [TASK] Renamed flux field viewhelpers

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

    [TASK] Happy new year!

commit 96632b08cff58b2410443e62d2263707676668ab
Author: Benjamin Rau <*****@codearts.at>
Date:   Fri Apr 4 11:23:41 2014 +0200

    [TASK] Add examples how to get file references
    
    Add some documentation and examples how to get file references assigned to the field created with this ViewHelper - one for pages and fluid content elements each because its different.

commit d25999d6966d6d587f348133e94b38955c0b467c
Author: Benjamin Rau <*****@codearts.at>
Date:   Fri Apr 4 23:33:14 2014 +0200

    [DOC] Use page.resources for page templates in example
    
    Fixes: 516

commit 3e70fba7bbc01f56383f38c486efe34c91546cce
Author: Claus Due <*****@namelesscoder.net>
Date:   Tue Apr 1 18:58:48 2014 +0200

    [FEATURE] Proper foreignTypes on all inline fields
    
    This change adds:
    
    * An InlineRelationFieldInterface with get/setForeignTypes
    * `foreignTypes` (array) argument on `flux:field.inline`
    * Transfer of `foreignTypes` to `Inline` component in `flux:field.inline`
    * Touch-up added variable type declaration in `flux:field.inline.fal`

commit 5c85840d649ac6639c36aaed365a7011d8d5f1a8
Author: Benjamin Rau <*****@codearts.at>
Date:   Mon Apr 7 14:07:30 2014 +0200

    [TASK] Allow usage of new foreignTypes argument
    
    Allow to use the new foreignTypes argument also on inline.fal ViewHelper but keep fallback definition.

commit 0e3d0830c4cecbd8cbb8366315d4e797294734e9
Author: Xaver Maierhofer <*****@xwissen.info>
Date:   Sun Jun 8 14:16:50 2014 +0200

    [TASK] Update vhs 2.0 namespaces

commit b9f2002bf6eda3fb28558b5dd8c875464e8b3c25
Author: G. Bodenschatz <*****@46halbe.de>
Date:   Wed Sep 17 00:43:56 2014 +0200

    [TASK] Remove unnecessary and unused aliases