Most elements of the Clay user interface are customizable using Lana custom fields. A custom field is a structured piece of data that can be added to various entities such as products, categories, menus, and content blocks. The structure of a custom field is dictated by a content model.
Clay comes equipped with its own content models. Before employing these content models in a Lana shop, they need to be synchronized. Clay provides a script for this synchronization. To align Clay's content models with your shop, run:
npm run sync-content-models
The script is interactive, so follow the on-screen instructions.
For more details, see: Content Models.
Structure
Lana intentionally maintains a flat structure for its content model. A content model can determine a single value of a basic type, such as string, boolean, number, date, or choice. Alternatively, it can be an object type featuring one or more fields of a basic type. However, arrays and nested objects are not supported.
To specify lists of items, such as displaying multiple user-defined categories on a page, you can use the following approach.
The solution lies in defining a standard structure of custom fields on an entity. Custom fields for content are arranged into sections, separated by a unique "separator" custom field. Code typically treats sequences of custom fields with the same content model as a single list, using this structure. This isn't a requirement, but a convention that Clay fully leverages. For example, the Home Page is composed of such sections when defined on the relevant content block.