File Types

New in version 1.2

For YAML reference refer to this page.

File Types are a special Content Type in TYPO3. They relate to the field type file. Every time you create a new file reference, the type of the child record is automatically determined by the file mime type.

There is a fixed amount of types:

  • text
  • image
  • audio
  • video
  • application

TYPO3 already provides a basic palette of fields, including an image manipulation module to handle crop areas. Now, if you happen to need an additional custom field, you have to completely override the type definition. A minimal example looks like this:

EXT:your_extension/ContentBlocks/FileTypes/image/config.yaml
name: example/file-type-image
typeName: image
prefixFields: false
fields:
  - identifier: image_overlay_palette
    type: Palette
    label: 'LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette'
    fields:
      - identifier: alternative
        useExistingField: true
      - identifier: description
        useExistingField: true
      - type: Linebreak
      - identifier: link
        useExistingField: true
      - identifier: title
        useExistingField: true
      - type: Linebreak
      - identifier: example_custom_field
        type: Text
        label: 'My custom Field'
      - type: Linebreak
      - identifier: crop
        useExistingField: true
Copied!

In this example, we re-define the image file type. For the most part everything is identical to the standard definition. We only added another custom field example_custom_field right before the crop field. Using this method, you have full control over the available fields and their position.

File reference in the TYPO3 backend