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 |
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. Defaults to 0. JavaScript record validation prevents the record from being saved if the limit is not satisfied. The field can be set as required by setting
minitems
to at least 1.
relationship
-
- Type
- string
- Default
- oneToMany
The relationship defines the cardinality between the relations. Possible values are
one
(default),To Many many
andTo 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 maxitems
will be automatically set to1
.
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>