Docs: Upgrading from 1.18

Upgrading from 1.18

A checklist for a theme forked on Tilspire 1.18.x, up to 1.19.2 — five habits that now cost something, five worth replacing, and the Template API call to use for each.

Most of Tilspire 1.19.0 is additive: a theme that changes nothing keeps working, and is simply floored on every contract it does not claim. Five habits now cost something, and five more are worth replacing. If your theme was forked earlier than 1.18.0, read the 1.17 notes and the older ones as well; each release lists only what changed since the one below it.

Five habits that now cost something #

  • It ships its own views/auth-close.php, views/auth-account.php or views/auth-mfa.php without the confirm part. A member who joined through a provider or a passkey has no password, and cannot confirm a change to the account. Draw $this->component('confirm-identity', ...) inside the form.
  • It ships its own views/auth-login.php that always shows "Create account". Sign-up can now be closed (Settings ▸ Security), and the link then leads to a notice. Hide it when $registrationOpen is false.
  • It ships its own views/auth-account.php and drops the sections' anchors. The account page's index links to #profile, #security, #privacy, #activity and #close. Keep them.
  • It builds /uploads/<file> by hand from a media-library filename. New uploads live in uploads/media/YYYY/MM/, so the guessed address only works through a redirect: every image costs an extra request. Use $this->picture($item) or $this->image($item).
  • It keeps a copy of a Blog, Forums or Feedback view. A copy keeps the old heading and misses every later change, because module views now draw their heading through the page-head component. Delete the copy, or ship components/page-head.php and end it with $this->pageHeadDefault().

Five habits worth replacing #

These break nothing.

  • Printing a count with number_format(), and a date with a format of your own. number_format() ignores the site's Regional format. Use $this->number($n) for counts and $this->timeTag($value, $style) for dates, which takes part in the Relative dates setting.
  • Linking the account menu to /account alone. Use $this->visitor()['profile_url'] and ['picture_url'], both '' when there is none, to link the profile and show the picture.
  • Drawing your own letter tile, or a plain name, for comment authors and Feedback's tracker items and replies. Since 1.19.2 comment authors carry user_id, picture_url and profile_url, and tracker items and replies carry author_face. Pass them to $this->component('person-avatar', ...), with person_name and never name, and link the name to profile_url when it is set. Core's comments component already does.
  • Writing your own copyright line in the footer. Print $this->footerCopyright() (escaped text), and fall back to your own line when it is ''. A theme that never calls it gets the line from core's floor once the owner fills the setting.
  • Writing a New topic link on a forum's page. Print $this->action('forums.node.start', $node), which draws the link, or nothing when this visitor may not start a topic (1.18.0).

The owner can also turn on three parts of a page in Pages ▸ Settings: the trail, "Last updated" and "In this section". A theme that does not place them, with component('page-breadcrumbs'), component('page-updated') and component('page-children') or the matching pageTrail(), pageUpdated() and pageChildren(), gets core's own in a default place (contract 12). A theme that shows no sign-in buttons gets none: core's views draw them, so a sign-in or sign-up view of your own calls the social-signin component.

Checklist #

Work down it once, search your theme's folder for each pattern, and change what you find.

  1. Confirm it's you. In your own views/auth-close.php, views/auth-account.php and views/auth-mfa.php, draw the part inside the form that changes the account, and keep the password field's name, current:
    <?php $this->component('confirm-identity', ['confirm' => $confirm, 'confirmId' => 'close', 'confirmFocus' => false, 'confirmThen' => 'reload']); ?>
    Load components/passkeys-script when $confirm['passkey'] is true.
  2. Closed sign-up. In your own views/auth-login.php, draw the "Create account" link only while sign-up is open:
    <?php if (($registrationOpen ?? true) !== false): ?><a href="/account/register">Create account</a><?php endif; ?>
  3. Sign-up forms. In your own views/auth-register.php, call <?php $this->signupChecks(); ?> last before the submit button, so the terms and privacy line sits just above it. Write no agreement text of your own; style .auth-legal.
  4. Reset and closing. In your own views/auth-reset.php, call $this->resetFactor($factor ?? null) and keep the code field's name, factor; core adds the part if you do not. A theme with its own views/auth-closing.php keeps both forms (step=cancel and step=leave) and the CSRF field csrf_token.
  5. Account anchors. Keep #profile, #security, #privacy, #activity and #close in your own views/auth-account.php.
  6. Uploads. Search for /uploads/. Replace each address you build from a media-library filename with picture($item) or image($item).
  7. Copied module views. Search your theme for copies of Blog, Forums and Feedback views. Delete each, or restyle with a small override: components/page-head.php ending in $this->pageHeadDefault(), a slot in components/slots/, or a small component such as blog-card, pager or person-avatar.
  8. Dates and numbers. Replace number_format() with number(), and a date you format yourself with timeTag().
  9. Faces. Draw a comment author's or a tracker item's face with person-avatar, and link the name to profile_url when it is set. Escape the addresses of a comment author; author_face is raw, and person-avatar escapes it.
  10. Account menu. Link visitor()['profile_url'] and show visitor()['picture_url'] when they are not ''.
  11. Footer. Print footerCopyright() where the footer's base line goes. Place the page parts you want with component(), or leave them to core.
  12. Version. Raise version in theme.json on every shipped change. Installing or updating a theme clears the page cache, and a theme copied onto the server another way clears it on the first visit after its version changes.
  13. Check. Load the site as a guest and as a signed-in member, with sign-up open and closed, and open a page with its settings parts on. Then check the Health page for warnings about your theme.

New in 1.19.2 #

These are additive, and each is optional.

  • Faces. Comment authors carry user_id, picture_url and profile_url; Feedback's tracker items and replies carry author_face; posts() items carry author_url, '' unless the person looking may open the author's profile. Print them with person-avatar and link the name when the address is set.
  • An editor stylesheet. An optional assets/editor.css styles the Pages and Posts editors. Start every rule with .tsp-editor. The Profile page offers the Immersive editor switch only while the active theme ships the file.
  • error_vars on tracker-suggest. The placeholders of the refusal's message, for the posting-limit refusal's :when: pass them to t() with the error key.

The calls named above are described on these pages: number, timeTag and pageHeadDefault on Head, assets and views; visitor and footerCopyright on Site, visitor and request; picture and image on Fields and pictures; pageTrail, pageUpdated and pageChildren on Other pages and menus; posts on Posts; action on Actions and sections; the sign-in calls on Sign-in, forms and consent; comments on Search, comments and previews; and the tracker calls on Tracker.