Modeling Data
Last updated
Last updated
The contents you create are based on Models. They describe the schema of your content, what are the fields available, the relations with other contents and the features a content has.
Each model is composed by 1 or multiple Fields that you define through the Model Builder interface.
Each content created with the Models are stored in Collections
Atlas CMS supports you on the creation of Models through the use of a Visual Model Builder that helps you to define your data.
The Models can be adjusted or changed at any time with an immediate effect on your contents. However, changing Models is not always without side effects for you project. There are circumstances where you may prefer to migrate contents from a Model to another because the changes of an old model affects the project in production or for any other needs. For these reasons, content modeling is a very delicate phase that requires you to think carefully about the use of this data before the implementation of the final project.
You can create your Models with the Visual Model Builder accessible through the left menu of the Admin UI.
The first time you access, Atlas CMS will allow you to create the first model. Selecting the Create Model button a modal screen comes up asking to enter the information required.
Models have properties you can edit when you create or update them, to define their behaviours:
Name: The name of the model, that will appear on the Menu.
Description: (optional) A description for the type of content the Model serves.
Key: The name of the API endpoint. Unique across Models.
Enable Localizazion: If the content created accepts multiple versions of it in different languages
Single Collection: If the collection allows only 1 content for the Model
Enable Stage Mode: If you want to have a publish/unpublish feature for contents of this Models
Icon: The icon representinig the Model, that will be visible in the left sidebar together with the name
Once a model is created, the screen will present a new item in the left sidebar, which allows access to the contents based on the model, and in the main section you will find the list of models (with the one just created already selected) with the ability to add new fields or new models
To create fields you need to select the Add Field button. A new modal comes up asking to select the type of Field you want to add.
There are many Fields available and ready to use. Each Field has a common set of properties, and can have a specific set properties (i.e. validation or visual editor types) that depends by the type of Field.
The Fields available are:
Text: Simple text input or text area.
Rich Text: Markdown or HTML editor
Number: Text input that accept only numbers, integer or float
Yes/No: Boolean true/false field
Date: Date Picker
Date Time: Date & Time Picker input
Time: Time Picker input
Single Choise: Radio Buttons or Dropdown Select
Enumeration: Checkboxes or Multiselect Dropdown
Tags: Free tags input
Media: Add a single image, document or video
Media gallery: Add a gallery of images, documents or videos
Color Picker: An RGB/Hex Color Picker input
Map: Coordinates values to store geographical information
Key/Value: A repeatable field to store an array of key/value data
Value Array: A repeatable field to store an array of simple strings
Json: To store a custom Json Object
Relations: To create relation to other contents of different models or of the same
Component: To embedded the data structure of a component
Multi Component: To embedded ad array of multiple dynamic components
For a detail of each Field you can read the chapter dedicated to