Documentation · ViewHelper reference

Field / FileViewHelper

Group (select supertype) FlexForm field ViewHelper, subtype "file"

Select and render an image

<flux:field.file name="settings.image" allowed="jpg,png,svg" showThumbnails="1" />

Then use <f:image> to render the image in the frontend:

<f:image src="{settings.image}"/>

alt and title tags are not loaded from the file's meta data record. Use <flux:field.inline.fal> if you want this feature. /

  • Tag usage example

    <flux:field.file 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" maxSize="123" allowed="NULL" disallowed="NULL" uploadFolder="NULL" showThumbnails="1" useFalRelation="1">
    	<!-- tag content - may be ignored! -->
    </flux:field.file>
  • Inline usage example

    {flux:field.file(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, maxSize: 123, allowed: 'NULL', disallowed: 'NULL', uploadFolder: 'NULL', showThumbnails: 1, useFalRelation: 1)}

Arguments

Argument Description Type
allowed

Defines a list of file types allowed in this field

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
default

Default value for this attribute

string
disallowed

Defines a list of file types NOT allowed in this field

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
exclude

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

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

Maxium allowed number of items to be selected

integer
maxSize

Maximum file size allowed in KB

integer
minItems

Minimum required number of items to be selected

integer
multiple

If TRUE, allows multiple selections

boolean
name

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

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
showThumbnails

If TRUE, displays thumbnails for selected values

boolean
size

Size of the selector box

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

Upload folder to use for copied/directly uploaded files

string
useFalRelation

use a fal relation instead of a simple file path

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 7e151e5cefb19a080d2d1bea2951cdea2db97b15
Author: G. Bodenschatz <*****@46halbe.de>
Date:   Wed Sep 17 00:46:37 2014 +0200

    [TASK] Add missing aliases