§16
A theme from scratch, step by step
- Copy: copy the
templates/starterfolder astemplates/<name>(name: lowercase letters, digits,-). Intheme.phpmakenamethe same as the folder name; fill intitle,version(1.0.0),requires('wiacp' => '>=0.2.0-alpha.79'),layout_mode(sharedorseparate) andcolor_modes. - Skeleton: keep the required output in
header.wcp/footer.wcp(§13 item 2). If you choseseparate, addclientheader.wcp/clientfooter.wcp; the panel's menu and links are in$panel(§5.3), the signed-in client (name, initials, badge counts) in$account(§5). - Style and script: put them under
assets/cssandassets/jsand link them withtheme_asset(). Define administrator settings such as colour and corner radius withsettingsand bind them to CSS variables (§3); in addition, the administrator can write custom CSS that loads after the theme styles (§5.8). - Pages: first
homepage.wcp, then add the pages you need with the names in §5.0. In each one use the variable table of the matching section; print forms with the*_htmlparts. Pages you do not add open with the core view and do not break the site. - Texts: all visible texts with
@t('key');language.phpin the source language, translations inlanguages/<language>.php(§9). - Validate and preview: the theme is listed in the Themes › Client Interface screen; validation errors appear there. Try it only in your own session with Preview; then apply the §13 checklist.
- Package and sign: if you will distribute it, prepare a signed package (§11). An unsigned theme can be used too, but it appears with the Unsigned badge in the admin screen and the update pre-check cannot track changes.
- Version: raise
versionon every release (at least the patch version when a file changed). The browser cache depends on versioned addresses; if the version does not go up, visitors may see the old CSS for up to a week.