Folder

The Folder type enables to select one or more folders. This field type is resolved to an array of \TYPO3\CMS\Core\Resource\Folder objects.

Settings

Name Type Default Required
array
integer
integer
string oneToMany

elementBrowserEntryPoints

elementBrowserEntryPoints
Type
array

Enables to set an entrypoint, from which to select folders by default.

maxitems

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

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

relationship
Type
string
Default
oneToMany

The relationship defines the cardinality between the relations. Possible values are oneToMany (default), manyToOne and oneToOne. 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, maxitems will be automatically set to 1.

Examples

Minimal

name: example/folder
fields:
  - identifier: folder
    type: Folder
Copied!

Advanced / use case

name: example/folder
fields:
  - identifier: folder
    type: Folder
    elementBrowserEntryPoints:
      _default: '1:/styleguide/'
    minitems: 1
Copied!

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 getFiles() method. In Fluid this looks like this for a field with identifier: folder.

<f:for each="{data.folder}" as="folder">
    <f:for each="{folder.files}" as="item">
        <f:image image="{item}" />
    </f:for>
</f:for>
Copied!