Folder
The
Folder type enables to select one or more folders. This field type
is resolved to an array of
\TYPO3\ objects.
Settings
| Name | Type | Default | Required |
|---|---|---|---|
| array | |||
| integer | |||
| integer | |||
| string | oneToMany | ||
| integer | |||
| boolean | false | ||
| string | |||
| object | |||
| object | |||
| object | |||
| boolean | |||
| boolean | |||
| boolean | false | ||
| boolean | false | ||
| integer | 1 |
elementBrowserEntryPoints
-
- Type
- array
Enables to set an entrypoint, from which to select folders by default.
maxitems
-
- Type
- integer
Maximum number of items. Defaults to a high value. JavaScript record validation prevents the record from being saved if the limit is not satisfied.
minitems
-
- Type
- integer
Minimum number of items. Default is no minimum. JavaScript record validation prevents the record from being saved if the limit is not satisfied. The field can be set as required by setting
minitemsto at least 1.
relationship
-
- Type
- string
- Default
- oneToMany
The relationship defines the cardinality between the relations. Possible values are
one(default),To Many manyandTo One one. In case of a [x]toOne relation, the processed field will be filled directly with the folder instead of a collection of folders. In addition,To One maxitemswill be automatically set to1.
autoSizeMax
-
- Type
- integer
The field will never grow larger than this number of visible rows.
behaviour.allowLanguageSynchronization
-
- Type
- boolean
- Default
- false
Allows to select if localization uses custom or default language value.
default
-
- Type
- string
Default value set if a new record is created.
fieldControl
-
- Type
- object
See TCA fieldControl. The
elementcontrol can be disabled viaBrowser field.Control. element Browser. disabled: true
fieldInformation
-
- Type
- object
See TCA fieldInformation.
fieldWizard
-
- Type
- object
See TCA fieldWizard.
hideDeleteIcon
-
- Type
- boolean
Removes the delete icon next to the selector box.
hideMoveIcons
-
- Type
- boolean
Removes the move icons next to the selector box.
multiple
-
- Type
- boolean
- Default
- false
Allows the same folder to be selected more than once in the list.
readOnly
-
- Type
- boolean
- Default
- false
Renders the field in a way that the user can see the value but cannot edit it.
size
-
- Type
- integer
- Default
- 1
Number of visible rows in the selector box. A value of 1 displays a drop-down.
Examples
Minimal
name: example/folder
fields:
- identifier: folder
type: Folder
Advanced / use case
name: example/folder
fields:
- identifier: folder
type: Folder
elementBrowserEntryPoints:
_default: '1:/styleguide/'
minitems: 1
Usage in Fluid
In most cases you want to retrieve the files within the folders. To achieve
this, you have to access the files via the
get method. In Fluid
this looks like this for a field with
identifier: folder.
Hint
If you've defined
relationship: many, then you can omit the
outer
f: loop.
<f:for each="{data.folder}" as="folder">
<f:for each="{folder.files}" as="item">
<f:image image="{item}" />
</f:for>
</f:for>