Actions with attribute sets
The attributes subsection is in the project settings. It lists attributes sorted by type (opens in a new tab) and has a form for creating new ones.
Creating attribute sets
To create an attribute set, enter its name, a unique identifier used to retrieve the entity, and type. After you click the create button, the new set appears in the attribute list.
Changing the position of an attribute set
You can change the order of attribute sets in the list.
Press and hold the icon on the set you want to move, then drag it to a new position.
Changes are saved automatically.
Editing attribute sets
After you create an attribute set, add attributes to it to hold the content.
To open the editor, click the gear icon on the set.
The editor shows the existing attributes and a form for adding new ones. Above the attribute table is a gear for choosing columns; see Column gear.
To add an attribute, enter its name and unique marker, and select the type of data the field will hold. A set can contain any number of attributes. You can add validators (opens in a new tab) to the attributes in a set and configure their type-specific properties (opens in a new tab).
This lets you build structures of related data and gives you more control over your project.
Hiding attribute sets
You can add attribute sets to entities according to their type. For example, you can link a set of the "Products" type to any product, and an "Administrators" set to an administrator entity. The system suggests which attribute sets you can add to a given entity. To remove a set from these suggestions without deleting it, use the eye icon.
This way you can hide outdated attribute sets that you no longer plan to use but that are already used in the project, which can make them hard to delete. A hidden set stays in the attribute list and can still be edited.
Hiding an attribute
If you don't want to use one or more attributes from a set, you can hide them. Click the eye icon on an attribute to hide it: it is no longer shown along with the other attributes of the set. The attribute still appears in the attribute list, but it is not added when the set is added to an entity.
Deleting attribute sets
To delete an attribute set you no longer need, click the trash can icon. After you confirm the action in the pop-up window, the set is deleted.
If an attribute set is used in your project, an icon with the hint "is not available for deletion as it is being used by data" appears next to its name in the list.
You can't delete such a set: the delete button in its row is unavailable.
Click the icon to open the Attribute Set Usage window, which lists the entities (products, pages, forms, and so on) that use the set.
Editing is restricted too: in the attribute editor, the Marker field is locked with the message "Editing is not available as this attribute set is being used," and in the settings of the set itself, the Templates only checkbox is unavailable.
Deleting an attribute
Inside the attribute set, select the attribute you want to delete and click the delete icon .
Unlike an attribute set, an attribute can be deleted even if it is already used in your project. It is removed from every entity that uses it, together with the data stored in it.
Adding attributes
You can't work with an attribute set until it is added to an entity. To use a set, link it to an entity of its type. For example, a set for products is linked to a product, and a set for administrators is linked to an administrator entity.
To link a set, open the entity and go to its attributes subsection. Select one of the attribute sets the system suggests, and it is added automatically. If the list is empty, you have no non-hidden attribute sets of that type. In that case, go back to the attribute settings and create one.
In this example, we create an attribute set for pages, then go to the pages section, select a page, and open its attributes section. After you add the set, its attributes appear and you can fill them in. The values you enter are linked to the page, and you can access them through the API in your project. Data entered in attributes can be validated.
Editing attributes
To edit an attribute in a set, click the gear icon in the Actions column of the attribute list. The page that opens has four fields:
- Name - the attribute name.
- Marker - the unique a unique identifier used to retrieve the entity.
- Additional fields - lets you add extra fields. The attribute's own value is dynamic: the same attribute can have different values in different pages, blocks, forms, events, etc.. A value you set in Additional fields is static. You can use Additional fields for different purposes, for example, to add an image placeholder for the attribute or to store tooltip text. The key point is that the value is static: whatever you specify is stored in the attribute every time you use it. You can add several fields in Additional fields. The available types are:
- String
- Integer
- Real
- Float
- Date and Time
- Date
- Time
- File
- Image
- Json
- Validation rules - rules for validating the attribute. They are described in the following chapters. (opens in a new tab)
Attribute templates
You can have attributes selected automatically each time a new document is created. To do this, set up a template:
- In the attribute set settings, select "Templates only".
- Open the "Templates" tab in the "Settings" module and create a new template with the parameters you need.
- Open the settings of the new template and select the attribute set you configured earlier.
Now you can fill in the attributes in the selected set, so that every new document that uses this template already has the required data in its attributes.
To apply the template, open the settings of the document and select your template from the list.
Duplicate marker
Every marker in the system is unique and must not repeat. If you enter a marker that already exists, you get a message saying so and an offer to use it for the new attribute.
If you accept, the system automatically copies all settings of that attribute (name, validators, additional fields, and so on), which makes later searches across documents easier.