WIACPSite theme 0.2.0-alpha.92
Türkçe

§16

A theme from scratch, step by step

  1. Copy: copy the templates/starter folder as templates/<name> (name: lowercase letters, digits, -). In theme.php make name the same as the folder name; fill in title, version (1.0.0), requires ('wiacp' => '>=0.2.0-alpha.79'), layout_mode (shared or separate) and color_modes.
  2. Skeleton: keep the required output in header.wcp / footer.wcp (§13 item 2). If you chose separate, add clientheader.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).
  3. Style and script: put them under assets/css and assets/js and link them with theme_asset(). Define administrator settings such as colour and corner radius with settings and bind them to CSS variables (§3); in addition, the administrator can write custom CSS that loads after the theme styles (§5.8).
  4. 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 *_html parts. Pages you do not add open with the core view and do not break the site.
  5. Texts: all visible texts with @t('key'); language.php in the source language, translations in languages/<language>.php (§9).
  6. 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.
  7. 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.
  8. Version: raise version on 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.