Docs: Upgrading from 1.20
Upgrading from 1.20
What a theme forked before Tilspire 1.21.0 should change, what stays hidden until you place it, and what is new.
Tilspire 1.21.0 is additive: a theme that changes nothing keeps working. A few habits now cost something, and some parts stay hidden until you place them. If your theme was forked earlier than 1.20.0, read the 1.19 notes and the older ones as well; each release lists only what changed since the one below it.
Habits that now cost something #
- It loads
blog-share.jsby its path. The Blog's share script is gone, so the address answers 404. The share row is now core'ssharecomponent. Remove the line. - It sets no
--cms-accent. The share row takes its colour from it. Without it the row is blue, where the Blog's was green. Set it to your accent colour. - It has a
comments-formview of its own that leaves out$restriction. A member who is restricted from commenting is then told nothing. Draw it with therestriction-noticecomponent. - It has an
auth-accountview of its own that escapeswhereandreason. In$restrictionsboth arrive already escaped, with<bdi>around them. Escape them a second time and readers see the markup. - It draws Forums or comments from its own views and leaves out
images. Pictures on a forum post or comment then do not show. - It prints a full date in
title. Usedata-tooltip, astimeTag()now does.
What stays hidden, or is drawn for you, until you place it #
These break nothing.
- Direct messages. The
message-envelopecomponent, beside the bell, andmessageButton()show only where your templates place them. - The Share row. While
pageShare()is unclaimed, core'spage-sharedraws it at the end of a page, just before the footer. CallpageShare()or place the component to put it where you want it. - The privacy policy addition. Core's
page-policydraws it last in<main>untilpagePolicy()or the component claims it. - Online status. The dot shows only where a view asks for it with
viewerSeesPresence()and apresence_idonperson-avatar. - Badges. Forums'
forums-awardscomponent draws the badges beside a name in a post, and core'smember-profileview draws the badges card. A theme that does nothing gets both. - The rules page. Core's
views/rules.phpdraws/ruleswhile your theme ships none. - The rules link in the footer. Core adds it before the last
</footer>until you callrulesLink('footer')where you want it.
Checklist #
Work down it once, search your theme's folder for each pattern, and change what you find.
- Share script. Search for
blog-share.jsand remove each line that loads it. The oldblog-shareclasses stay beside the newcms-share*ones. - Accent. Set
--cms-accentto your accent colour. - Comment form. In your own
comments-formview, draw$restrictionthrough therestriction-noticecomponent. To take pictures, drawpictures-fieldwithform.imagesasmax, only while it is above 0, and send the form asmultipart/form-data. - Restrictions in the account page. In your own
auth-account, print each restriction'swhereandreasonas they are, and give the section the idrestrictions. - Pictures. In your own comment list or Forums view, print each item's
imagesafter its body, with both addresses escaped, or hand them to thepicturescomponent. Printt('images.failed')whenimages_failedis true. - Dates. Search for
title=on a date. Move the full date todata-tooltip. - Messages. Place the
message-envelopecomponent beside the bell, and scope your CSS for it to the header, for example.site-header .dm-envelope. - Signature. If a file of yours replaces the slot
account-profile-extra, draw the slot, or members cannot edit their signature. - Version. Raise
versionintheme.jsonon every shipped change. - Check. Load the site as a guest and as a signed-in member. Open a post with the Share row on, a comment form as a restricted member, the community rules page and the account page. Then check the Health page for warnings about your theme.
New in 1.21.0 #
These are additive, and each is optional.
- Share.
pageShare()gives{title, url, path, links, script}for thesharecomponent. It isnullunless Share is on in Pages ▸ Settings and on the page, and the page is published. See Other pages and menus. - Privacy policy addition.
pagePolicy()lists the site's addition to the privacy policy, for thepage-policycomponent. - Online status and messages.
viewerSeesPresence(),messageButton()and themessages_*keys ofvisitor(). See The site, the visitor and the request. - Restrictions.
restrictionNotice()and therestriction-noticecomponent. - Community rules.
rules(),rulesLink()andrulesAccept(). See Sign-in, forms and consent. - Pictures.
imageson comments,form.imagesand thepicturesandpictures-fieldcomponents. See Search, comments and previews. - Reports and actions.
report()gainsrules, and three actions are new:forums.post.restrict,core.member.banandcore.member.restrict. See Actions and sections. - Tokens.
--cms-online,--cms-accent,--fx-award-tip-radius,--fx-award-tip-bg,--fx-award-tip-inkand--cms-target-bg, which marks a rule you jumped to. Each has a fallback. - Dates.
timeTag()keeps the full date indata-tooltip. The newclockstyle is a site setting, so your theme draws nothing extra.
The theme guide, site/themes/README.md, in every copy of Tilspire, describes every 1.21.0 call under "Upgrading an older theme" and in the Template API's tables. Both shipped themes are already updated.