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
integer
boolean false
string
object
object
object
boolean
boolean
boolean false
boolean false
integer 1

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

autoSizeMax

autoSizeMax
Type
integer

The field will never grow larger than this number of visible rows.

behaviour.allowLanguageSynchronization

behaviour.allowLanguageSynchronization
Type
boolean
Default
false

Allows to select if localization uses custom or default language value.

default

default
Type
string

Default value set if a new record is created.

fieldControl

fieldControl
Type
object

See TCA fieldControl. The elementBrowser control can be disabled via fieldControl.elementBrowser.disabled: true.

fieldInformation

fieldInformation
Type
object

fieldWizard

fieldWizard
Type
object

hideDeleteIcon

hideDeleteIcon
Type
boolean

Removes the delete icon next to the selector box.

hideMoveIcons

hideMoveIcons
Type
boolean

Removes the move icons next to the selector box.

multiple

multiple
Type
boolean
Default
false

Allows the same folder to be selected more than once in the list.

readOnly

readOnly
Type
boolean
Default
false

Renders the field in a way that the user can see the value but cannot edit it.

size

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