Storing Data Types as Attributes

When planning how to structure your MetaModels, in addition to the database structure, it is important to know what options are available for storing your real data such as texts, numbers, dates, postal codes, etc. Both the data types of the database (MySQL/MariaDB) and the input options via Contao widgets must be taken into account.

The following is an overview of which attributes can be used to store the desired data. Additionally, “filter rule” indicates which filter rules for filtering/search can be used in the frontend. It also shows which attributes are available for frontend editing (FEE) (✔) — additional repositories may need to be installed (🗹).

Texts

Data type

Attribute

Package name

Filter rule

FEE

Note

Short texts

Text

attribute_text

Text search,
Single select,
Multi-select,
Simple lookup,
Register,
Levenshtein,
Loupe

up to 255 characters;
number of attribute limited
by DB

Long texts

Long text

attribute_longtext

Text search,
Levenshtein,
Loupe

up to 65535 characters;
adjustable;
File-Usage

Text as alias

Alias

attribute_alias

Text search,
Simple lookup,
Levenshtein,
Loupe

up to 255 characters;
Generation from one
or more attributes

Combined values

Combined values

attribute_combinedvalues

Text search,
Single select,
Multi-select,
Simple lookup,
Register,
Levenshtein,
Loupe

up to 255 characters;
Result string definable via sprintf

Text as table

Table text

attribute_tabletext

Levenshtein,
Loupe

🗹

up to 255 characters per cell

Text as URL

URL

attribute_url

Levenshtein,
Loupe

🗹

up to 255 characters;
Character count for title and URL

Text as token

Token

attribute_token

Text search,
Single select,
Multi-select,
Simple lookup,
Register,
Levenshtein,
Loupe

up to 255 characters;
Character count incl. optional prefix

Multilingual

Short texts multilingual

Translated text

attribute_translatedtext

see Text

up to 255 characters

Long texts multilingual

Translated long text

attribute_translatedlongtext

see Long text

see Long text;
File-Usage

Text as alias multilingual

Translated alias

attribute_translatedalias

see Alias

see Alias

Combined
values multilingual

Translated combined values

attribute_translatedcombinedvalues

see
Combined values

see Combined values

Text as
table multilingual

Translated table text

attribute_translatedtabletext

Levenshtein,
Loupe

🗹

see Table text

Text as
URL multilingual

Translated URL

attribute_translateurl

Levenshtein,
Loupe

🗹

see URL

Numbers

Data type

Attribute

Package name

Filter rule

FEE

Note

Integer values

Numeric

attribute_numeric

Value from/to for one attribute,
Value from/to for two attributes

for postal codes or phone numbers use
Text attribute

Decimal numbers

Decimal

attribute_decimal

Value from/to for one attribute,
Value from/to for two attributes

Input with period as decimal separator

Date or time

Timestamp

attribute_timestamp

Value from/to for one date attribute,
Value from/to for two date attributes

Stored as UNIX timestamp;
Input can be limited to date only
or time only

Geo coordinates

see Decimal

Perimeter search

create one attribute each
for latitude and longitude

Files

Data type

Attribute

Package name

Filter rule

FEE

Note

File

File

attribute_file

✔ Upload

searchable in BE by filename or UUID;
image size selectable for image output;
File-Usage

Multilingual

File multilingual

Translated file

attribute_translatedfile

✔ Upload

see File;
File-Usage

Transfer e.g. to a Rocksolid Slider.

Boolean Value

Data type

Attribute

Package name

Filter rule

FEE

Note

Boolean value

Checkbox

attribute_checkbox

Checkbox status

Display in BE list as toggle icon possible

Multilingual

Boolean value multilingual

Translated checkbox

attribute_translatedcheckbox

Translated checkbox status

see Checkbox

Relations

Data type

Attribute

Package name

Filter rule

FEE

Note

1:n

Single select [select]

attribute_select

Single select,
Filter on attribute of model with a relation

Relation to another table for one value
MM tables or other Contao tables

m:n

Multi-select [tags]

attribute_tags

Multi-select,
Filter on attribute of model with a relation

Relation to another table for multiple values
MM tables or other Contao tables

Multilingual
Single and multi-select can
inherently handle multilingual MMs

1:n

Translated single select [select]

attribute_translatedselect

Single select

only for special cases with own column for language key

m:n

Translated multi-select [tags]

attribute_translatedtags

Multi-select

only for special cases with own column for language key

Further information can be found on the page Relations in MetaModels.

Further Data

Data type

Attribute

Package name

Filter rule

FEE

Note

Color value

Color picker

attribute_color

🗹

Opacity/transparency also selectable;
sorting by color possible;
see attribute Color

Content elements

Content of an article

attribute_contentarticle

multiple content elements like an article;
File-Usage

Country names

Country

attribute_country

available countries can be restricted

Language codes

Language code

attribute_langcode

available languages can be restricted

Geo distance

Geo distance

attribute_geodistance

additional info for sorting
perimeter search results

Star rating

Rating

attribute_rating

number of stars selectable

MCW table

Table multi (MCW)

attribute_tablemulti

🗹

see attribute for Multi-Column-Wizard;
File-Usage

Pin for Cowegis map

Cowegis marker

cowegis-layer

see Cowegis layer integration for marker

Multilingual

Content elements
multilingual

Translated content of an article

attribute_translatedcontentarticle

see Content of an article;
File-Usage

MCW table
multilingual

Translated table multi (MCW)

attribute_translatedtablemulti

🗹

see Table multi (MCW);
File-Usage

Output e.g. as CE-YouTube.