Components of a MetaModel
The following chapters describe the structure of MetaModels to help understand the “logic” of how the extension is built.
First, a clarification of two terms: MetaModel (singular) will refer to a data table with its attributes, input/output options, filters, etc. A MetaModel is written without “s” in the following texts, even if this would be required grammatically.
The term MetaModels (plural) stands alone as the name for the extension package for Contao.
For newcomers or those returning to MetaModels, it may be somewhat difficult to find a suitable workflow for creation. For this audience, there is a simple workflow for working with MetaModels. There are also some tips for getting started and an overview of which attributes can store what data.
Before creating more complex data structures in MetaModels, you should definitely think about an “elegant” structure — especially the relations between models. There is an overview page “Relations in MetaModels” for this.
After creating a MetaModel, the following main components are available for editing:
When creating a (simple) MetaModel, the components can be worked through in the order listed. As the complexity of the MetaModel increases — i.e. when multiple MetaModels interact with each other — you will inevitably need to supplement or modify individual entries in an existing MetaModel.
In addition to the main components, there are further configuration options, such as creating grouping/ sorting of items in a backend list or display conditions for input widgets in an input form.
For an easier overview of where to find what, there is the
"MM layout map" available for download.
The MetaModels extension adds two new content elements and modules to Contao for frontend output. The content element/module “MetaModel list” allows records to be displayed individually or as a list on the website, and the content element/module “MetaModel frontend filter” provides a filter for the frontend — more about this under Content Elements/Modules for Frontend Output.
How the individual templates interact is described on the Templates in MetaModels page.
MetaModels is very well suited for working with multilingual content — more about multilingual support in MM.
To output individual values of a record (item) or the number of all records in the Contao context, various insert tags are available.