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 search, |
✔ |
up to 255 characters; |
||
Long texts |
Text search, |
✔ |
up to 65535 characters; |
||
Text as alias |
Text search, |
✔ |
up to 255 characters; |
||
Combined values |
Text search, |
✔ |
up to 255 characters; |
||
Text as table |
Levenshtein, |
up to 255 characters per cell |
|||
Text as URL |
Levenshtein, |
up to 255 characters; |
|||
Text as token |
Text search, |
✔ |
up to 255 characters; |
||
Multilingual |
|||||
Short texts multilingual |
see Text |
✔ |
up to 255 characters |
||
Long texts multilingual |
see Long text |
✔ |
see Long text; |
||
Text as alias multilingual |
see Alias |
✔ |
see Alias |
||
Combined |
see |
✔ |
see Combined values |
||
Text as |
Levenshtein, |
see Table text |
|||
Text as |
Levenshtein, |
see URL |
Numbers
Data type |
Attribute |
Package name |
Filter rule |
FEE |
Note |
|---|---|---|---|---|---|
Integer values |
Value from/to for one attribute, |
✔ |
for postal codes or phone numbers use |
||
Decimal numbers |
Value from/to for one attribute, |
✔ |
Input with period as decimal separator |
||
Date or time |
Value from/to for one date attribute, |
✔ |
Stored as UNIX timestamp; |
||
Geo coordinates |
see Decimal |
Perimeter search |
— |
create one attribute each |
Files
Data type |
Attribute |
Package name |
Filter rule |
FEE |
Note |
|---|---|---|---|---|---|
File |
✔ Upload |
searchable in BE by filename or UUID; |
|||
Multilingual |
|||||
File multilingual |
✔ Upload |
see File; |
Transfer e.g. to a Rocksolid Slider.
Boolean Value
Data type |
Attribute |
Package name |
Filter rule |
FEE |
Note |
|---|---|---|---|---|---|
Boolean value |
Checkbox status |
✔ |
Display in BE list as toggle icon possible |
||
Multilingual |
|||||
Boolean value multilingual |
Translated checkbox status |
✔ |
see Checkbox |
Relations
Data type |
Attribute |
Package name |
Filter rule |
FEE |
Note |
|---|---|---|---|---|---|
1:n |
Single select, |
✔ |
Relation to another table for one value |
||
m:n |
Multi-select, |
✔ |
Relation to another table for multiple values |
||
Multilingual |
|||||
1:n |
Single select |
✔ |
only for special cases with own column for language key |
||
m:n |
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 |
Opacity/transparency also selectable; |
||||
Content elements |
— |
multiple content elements like an article; |
|||
Country names |
✔ |
available countries can be restricted |
|||
Language codes |
✔ |
available languages can be restricted |
|||
Geo distance |
— |
additional info for sorting |
|||
Star rating |
— |
number of stars selectable |
|||
MCW table |
|||||
Pin for Cowegis map |
Cowegis marker |
✔ |
|||
Multilingual |
|||||
Content elements |
— |
see Content of an article; |
|||
MCW table |
see Table multi (MCW); |
Output e.g. as CE-YouTube.