A type of section: the pair of files sections/{name}.phtml (how it is rendered, PageRenderer) and sections/{name}.schema.json (what its data holds), found in Pages::$templates.
class MMO\editor\cms\SectionType
implements JsonSerializable
The schema is a JSON Schema object with a few keys of the page editor's own:
- at the top: `label`, `icon`, `description` (what the "add a section" menu shows), `level` (the display level
from which it is offered: [`Modes`](https://mmoframework.fr/en/documentation/mmo.client/php/Modes.md#modes));
- on a field: `label`, `help`, `level` (from which level its input is shown: none is every level, `standard`,
`expert`), and `format`:
- `text` (the default for a string): plain text, escaped when it is printed;
- `html`: rich text from `<mmo-editor>`, sanitized when it is saved ([`Sanitizer`](https://mmoframework.fr/en/documentation/mmo.editor/php/cms/Sanitizer.md#sanitizer)) -- `"editor": "inline"`
keeps text formatting only, `"tools"` is the editor's toolbar;
- `url`: a link, only `http(s)`, `mailto`, `tel` or relative;
- `image`: `{src, alt}`, an address and its description;
- an `array` of objects is a list of items (the cards of a features section), each with its own fields.
- `default`: what a new section starts with.
Make what a client sent what the type says: html sanitized, urls checked, text trimmed of nothing, numbers and booleans as such. A field the schema does not know is left as it is, for validate to refuse.