There are two primary aspects to setting up a collection:
- creating a schema - which defines what properties each item (post) in the collection will have; and
- define a configuration - which determines how the collection should be managed by textsem
There are two primary aspects to setting up a collection:
The collection schema is a specal JSON file that defines the structure of the items in a collection. This is usually setup by a developer when building a site, but they can also be added and updated in Textstem.
[
{
"name": "title",
"label": "title",
"casts": "string",
"controltype": "text",
"required": true,
"value": ""
},
{
"name": "author",
"label": "author",
"casts": "string",
"controltype": "text",
"required": false,
"value": ""
},
{
"name": "content",
"label": "Content",
"casts": "string",
"controltype": "htmleditor",
"required": false,
"value": ""
}
]
Each entry in the schema can specify the following:
The attribute name
How the attribute is displayed in the Admin interface
The control type used to enter or select the value (default is a text input)
cast the value. This can be any of the Textstem types such as integer, float, date, datetime, boolean and string (default)
If the value is required
In addition to specifying a schema, collections can be configured to have specific list views, widgets and columns in the admin views.