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:
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
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_
right before the crop field. Using this
method, you have full control over the available fields and their position.
Note
This is a global definition, used in your entire TYPO3 installation. Only
use it, if you want to modify the arrangement of fields globally. Also,
don't use this in third party extensions. Better provide a
Basic
,
which the extension user should include in his project.
Tip
In case you only want to re-define a file definition in the context of another element, then use Type Overrides instead.
Note
If you have the option extendedPalette
set to
false
, this definition won't be displayed and you will get
the basic palette instead.
