Types
Attributes differ by their binding type to entities. Each type corresponds to its own module in the system.
Thus, attributes are divided into:
- For Administrators
- For Blocks
- For Pages
- For Products
- For Users
- For Forms
- For Events
If you created an attribute for pages, you will not be able to use it in products or forms. When trying to bind an attribute to an entity, the system will suggest which attributes you can use in that place.
Features of Types
Some types have their own features that are important to know.
Attributes for Users
This type of attribute sets stores information about the users of your application. You can store login, email, username, address, workplace, etc. Information used for user verification must be explicitly specified in the system. Thus, you must indicate which field will be responsible for the login, which for the password, and which for the email. For the authorization system to work correctly, the user attribute set must contain these three attributes. You can collect other information about the user at your discretion.
Even if you use email as the login, you still need to create both the "login" attribute and the "email" attribute.
General list of unique capabilities for user attribute fields:
- Use as login
- Use as password
- Use for email notifications
- Use for phone push notifications
- Use for phone SMS notifications
- Use in sign-up form
Attributes for Products
This type of attribute stores information about products. Additional settings for this type of attribute set allow, for example, to specify to the system which attribute you want to use as the product price.
General list of unique capabilities for product attribute fields:
- Contains price
- Contains currency
- Includes SKU
- Includes tax rate
General Type Attributes
General type attribute sets do not have additional settings for their fields.
Images
An attribute of type "Image" or "Group of Images" contains one or more image files and provides additional tools for working with the files.
Loading Optimization
Attributes related to image uploads have a loading optimization setting. Optimization is enabled by default, so if you want to upload the original image without quality loss, go to the attribute settings and disable this setting.
Preview
If there are multiple image attributes, and you want a specific image to be displayed within the system, go to the settings of the corresponding image attribute and enable the "Use as a preview in the product list" setting. After that, in the catalog, the selected image will be the main one for the product.
Preview Template
You can add a preview image template to the image attribute. More about preview templates can be found here.
Menu Icon
For the attribute of type Image, intended for pages, you can specify that this image will serve as an icon in the menu.
Lists
An attribute of type "List" contains one or more properties, pre-configured in the attribute and used in entities by choice.
List Configuration
Open the editing mode of the attribute of type "List" by clicking on the edit icon
In the form for adding a new list property, specify:
- Name - A non-unique string used for operation within OneEntry Headless CMS.
- Value - A string denoting the value of the property.
- Type - The type of the property
- Additional Value - An optional parameter. If a value was not added to the list property, the additional value will be used.
After filling in, click the "Add" button. The new property will be added to the list.
Modifying a List Property
Select the property you want to modify and click the "Edit" button. All data of this property will be added to the form. Modify the property and click the "Edit" button.
Deleting a List Property
Select the property you want to delete and click the "Delete" button. The property will be removed and will disappear from the list.
Using an Attribute of Type "List"
After you have configured the list properties, attach the attribute set to the entity that corresponds to its type. Thus, an attribute set of type "For pages" can be attached to a page.
In the attribute field of type "List," you can select one property from the list.
Multi-select for an Attribute of Type "List"
If you need to save more than one property in the attribute, activate the "Allow multiple values selection" function by checking the corresponding box. With this function activated, you can add multiple values to the entity attribute at once.
Time Frames
An attribute of type "Time Frames" allows you to set a work schedule by specifying date intervals and assigning time periods to each interval for dynamic use in the attribute.
To start configuring, open the editing mode of the attribute of type "Time Frames" by clicking on the edit icon ‘Settings’
Configuring Date Intervals
On the provided calendar, select the necessary date interval. To create a 1-day interval, you need to double-click on the desired date.
If there is no need to create multiple intervals, click "Select entire month."
The last day of the month is a special interval that is dynamic and depends on the current month.
After selecting the interval, its configuration will become available.
Every week (available if the duration of the period is a week or less) – repeats the interval every week during the selected month. Every month – repeats the interval every month in the selected year. Every year – repeats the interval every year.
These are the three main settings that repeat in other elements of the attribute. They allow you to combine periodicity for selected elements. What does this mean? For example:
- To create a weekly schedule for the organization for the current year, you only need to select the working week interval (for example, Monday – Friday), and in the settings specify "Every week, every month."
- If you want to specify a specific interval for certain dates (for example, an autumn fair that takes place every October from the 1st) – For the interval 01.10 – 04.10, one setting "Every year" is needed. Combine settings for optimal results. "New time interval" - clicking this button will provide a builder with fields: Start period – input field for the start of the time interval End period – input field for the end of the time interval
Automatic Generation of Time Period
If you need to enter identical duration periods in a quantity different from one – this builder will help with the task. After clicking the button, you will see: The selector represents the choice of the duration of the time period within the time interval. If a period longer than one hour is needed, click the "Add hour" and "Subtract hour" buttons accordingly. After configuring the time interval, click the "Save" button to save the changes. Add intermediate interval – allows you to add intermediate time intervals (for example, break time). Clicking will open a selector, just like for automatic generation of the time period.
Exceptions
If you need to enter special rules for certain dates, simply click on the desired date in the interval on the calendar, after which it will turn red and become available in the "Exceptions" list. Attention! Without configuring exceptions, it will simply be highlighted in the intervals. Configuring an exception is similar to creating a date interval – Every week, Every month, Every year, but there are also additions. All day – allows you to completely exclude the selected day from the interval. It becomes unavailable for selection in attributes. Or you can close specific time intervals, which are presented in a list below. By clicking the "settings" button, a modal window will open with all the time periods set for the date interval, where you can select the excluded time intervals if not the whole day.
If other exceptions have been generated based on it, they can be excluded again – that is, returned to the created date interval.
Selection in the Attribute
Working with configured intervals involves selecting the start and end of the period in which the specified time is chosen. How is this arranged? First, in the calendar, you need to select the start date and the end date.
Next, if time intervals have been created, they will appear in the right column, available for further selection.
After selecting the interval, it will go to the list of selected intervals, where you can configure the periodicity "Every week," "Every month," "Every year."
Selecting time intervals adds each to the list of selected intervals.
If you need to exclude certain dates from the selected period, they can also be added and configured. To do this, simply click on the desired date in the active interval, after which the selection will go to the "Exceptions" list.
Configuring an exception also involves selecting periodicity "Every week," "Every month," "Every year." Additionally, for the exception date, you can configure time exceptions. To do this, click the settings button, after which the calendar will be replaced with a list of time intervals, where you can select the excluded time intervals for the selected date.
If you need to refuse an exception but keep its periodicity in other cases, you can click on the generated exception (Attention! Clicking on the original exception date will cancel the entire chain of exceptions!), after which the date will go to the "Except" list of the exception.
.