Client area templates
A template is one folder of plain PHP pages and assets. Copy one, rename it, change it, and it is yours.
What a template is#
CoreInto ships three client area templates: Studio, Classic and Horizon. Each is one folder in templates/, complete on its own: its pages (.php), an assets/ folder with its styles, scripts, favicon and logo, and a template.json with its title, description, version and author. Nothing is shared between templates or with the admin area, so changing one never breaks another.
In a template folder, _start.php is the top of every page, _end.php the bottom and _head.php the HTML head. Files starting with _ are pieces used inside pages; the others are the pages, named after them: dashboard.php, store.php, invoice.php and so on.
Making your own#
- Download a template folder, for example
templates/classic. - Rename it with lowercase letters, digits,
-and_, for examplemy-brand. - Set the title and description in its
template.json. - Change its pages and assets.
- Upload it into
templates/. It appears under General Settings > Client area template at once.
Link the template's own files with $app->templateAsset('name.css'). The template's pages are never served directly; its assets/ folder is.
The security policy#
Pages are sent with a strict Content Security Policy: no inline styles and no inline scripts. Put every style and script in your assets. Data a script needs can go in data- attributes.
Keeping it through updates#
Updates replace only studio, classic and horizon. Your own folder is never touched. When a release adds a page to the client area, compare your template with the new Classic and copy the new page across; the release notes say when that is needed.
The website builder's themes#
The public website built with the website builder has its own themes in website/themes/, with the same rules.