Who this guide is for
Theme developers who write page and component templates, content modellers who create input types, layouts and their areas, and anyone reviewing either. It sits at levels L1 to L2: it assumes you can build and deploy a template (Core dna for site builders) and know Smarty or Twig (Template languages). Every template example is given in both engines.
The units, in order
- The model, end to end: the chain from an editor's field to the HTML, and where content is stored. Read it first.
- Input types: what an editor can enter, and what a template gets back for each category and editor.
- Layouts: a template joined to a set of editable areas; page designs and reusable components.
- Layout areas, groups and attributes: the author's editing form, field by field.
- Components, collections and global components: building a block library, and blocks that query records.
- Rendering areas in templates: every getter, what it returns, what it costs, and testing for empty.
- The shorthand, and working with each input type: the normal way to print a layout area, and why it keeps live preview working.
- Images end to end: from the image area to the delivered file.
- Patterns, live preview and upkeep: the idioms every mature site reinvents, and keeping a library tidy.
A component template, the usual way
A component with a heading (Text), a body (Richtext) and a cssClasses (Text) area. Values printed on the page use the shorthand; the value inside the class attribute uses getAreaText(), because in live preview the shorthand wraps text in an editable element that does not belong inside an attribute (The shorthand and live preview):