Accent

Templates

Creating templates, directories and identity — the document shell a page renders through.


A template is an EJS file. There are no template kinds — no "document template" vs "partial" vs "fragment" as categories you choose at creation. What a template plays comes from where it is applied: bind it to a content type's HTML output and it is that type's page shell; embed it in a page and it is a band; mount it from another template and it is chrome.

In this section:

  • The content region — where the page body lands (data-accent-content), the legacy marker, and static templates.
  • Including templates — every way one template gets into another render: require(), include(), cms.partial(), and the editor/API lanes.

Creating a template

Manage Site → Templates → New template asks for the identity triple's two authored parts — a Title and a Slug (derived from the title until you edit it) — and nothing else. It writes a site EJS file at templates/<slug>.ejs, seeded as a bare section, and opens the source editor. Slashes in the slug create folders.

Design-in-code lanes exist too: the web API's template PUT, theme Customize (fork a theme file into the site), or dropping files into the site's internal tree.

Directories

templates/ is the canonical home for new files. Two deliberate exceptions:

  • Theme forks keep the theme's own rel path — resolution shadows by identical relative path (site file first, theme package second), so a fork parked anywhere else would stop overriding its theme original.
  • Legacy partials/-homed files keep working through their stored paths, and a require() that names the wrong directory tells you where the file actually lives.

Directories are organizational only — nothing reads meaning from them.

Identity

Templates carry the identity triple: a stable internal uid, the slug (renameable — every CMS-managed reference rides the uid, so renames are free), and the title (retitle any time). Authored EJS that mentions an old slug in a require() path is reported on rename, never rewritten.

Deep records

The content model — design record — the no-role amendment and the templates-directory ruling; The identity triple — design record — the rename mechanics.