Translated File

The “Translated File” attribute is the multilingual variant of the File attribute. It provides a separate file picker per language for selecting files from the Contao file directory. The values are not stored in the MetaModel table, but in the translation table tl_metamodel_translatedlongblob.

Typical use cases:

  • Language-specific product images (e.g. a DE product photo with German text, an EN product photo with English text)

  • Different PDFs per language (e.g. German and English data sheets)

  • Language-dependent media content such as videos or audio files

See also

The monolingual variant of this attribute is described under File.

See also

This attribute is supported by the File-Usage Integration. This allows the Contao file manager to display whether and where a file is embedded.

See also

For file uploads in the frontend, the Frontend Editing (FEE) extension is available.

See also

Information on multilingual support in MetaModels can be found on the Multilingual Support in MetaModels page.

Installation

The attribute is installed via the Contao Manager or Composer:

composer require metamodels/attribute_translatedfile

Settings when Creating the Attribute

In addition to the general attribute settings, the file attribute offers the following specific options:

Option

Description

Multiple selection

Allows the selection of multiple files. If this option is not set, only a single file can be selected.

Specify root folder

Restricts the file picker to a specific starting folder in the file directory.

Valid file types

Comma-separated list of allowed file extensions (e.g. jpg,jpeg,png,gif).

Allowed file types

Restriction of the selection to files, folders, or both.

Settings in Render Settings

The attribute has its own render settings for output:

Option

Description

Use as image field with thumbnail

Enables image output with thumbnail generation. This option must be set for any direct image display in the backend or frontend.

Image width and height

Size specification for the generated thumbnail (width × height).

Create link as download or lightbox

Embeds the file in a link that serves either as a download or for a large view in a lightbox.

Protected download

The download URL is only temporarily valid (time-limited signed URL).

Sort by

Defines the sort order for multiple files: name ascending/descending, date ascending/descending, or random.

Image as placeholder

Selects a placeholder image to be displayed when no file is selected.

Settings in the Input Form

When the attribute is added to an input form, the following options are available:

Display

Option

Description

Backend class

CSS classes for the display of the field in the backend form.

Template for backend

Selection of a custom widget template for the backend form.

Template for frontend

Selection of a custom widget template for frontend editing (only available if the “Frontend Editing” extension is installed).

Widget mode

Determines the display type of the file widget. Available modes:

  • Normal — Standard file picker

  • Downloads — Display as download list

  • Gallery — Display as image gallery

  • FE single upload — Frontend upload for a single file

  • FE single upload with preview — Frontend upload with thumbnail

  • FE multi upload — Frontend upload for multiple files

  • FE multi upload with preview — Frontend upload with thumbnails

Upload settings (only for frontend editing modes)

Option

Description

Target folder

Folder in the file directory where uploaded files are stored.

Use home directory

Stores the file in the home directory of the logged-in member.

Expand folder

Expands the target folder path dynamically via insert tags or ##post_*## tokens.

Normalize expanded folder

Normalizes the expanded folder path with the alias generator.

Normalize filename

Normalizes the filename on upload with the alias generator.

Filename prefix / postfix

Prepends or appends a fixed or dynamic text to the filename.

Preserve existing files

Adds a numeric suffix for duplicate filenames instead of overwriting the file.

Deselect file

Allows the user to remove a file from the record.

Delete file

Allows the user to remove a file and delete it from the file directory.

Sort by

Defines the sort order of uploaded multiple files.

Width and height of thumbnails

Size of the thumbnails displayed in the upload widget.

Functions

Option

Description

Required field

Makes the field a required field.

Overview (backend filter and search)

Option

Description

Filterable

The attribute is available in the backend as a filter criterion.

Searchable

The attribute is available in the backend as a search field.

Filter Rules

No dedicated frontend filter rule is currently available for the translated file attribute. A search by filename or UUID is possible in the backend.

Special Functions

Database storage

The file references are stored per language in tl_metamodel_translatedlongblob (fields: att_id, item_id, langcode, value as blob). No column is created in the MetaModel table.

Language-dependent files

Each language version can reference a completely different file. In the backend, the file widget appears per language with the language-specific value.

Fallback language

If a file is missing for a language, MetaModels falls back to the fallback language.

Sorting for multiple files

The order of multiple files can be configured independently in the render settings (for output) and in the input form settings (for frontend upload).