5.1.4
Turn parts off
Turn Groundcrew's optional parts on or off with one switch each, and see what goes with each part.
Not every business needs every part. A cleaner may have no projects to show, and a builder may have no emergency line. Each optional part of Groundcrew has one switch. When a part is off, it leaves no trace on the site: no page, no link and no empty box.
Set a switch
The switches are in switches in content/site.json:
"switches": { "areas": false, "posts": false }
Each switch is true, false or left out.
- Left out: the preset decides. See What each preset turns on.
false: the part is off. It always wins.true: the part is on, but only when there is something to show. A switch that is on with nothing behind it stays off. For example,projectsis off while you have no published projects.pnpm test:adapterprints a warning that says why.
On EmDash, each switch is a field under Business details, such as “Switch: Projects”, with three choices: Preset, On and Off. A change shows on the next request, with no rebuild.
The switches
| Switch | The part | On only when there is |
|---|---|---|
projects |
The projects pages, the list per service and every project card and link. | A published project. |
areas |
The area pages, the ZIP check and the area chips. | A published area. |
posts |
The blog, its tag pages, its feed and its bylines. | A published post. |
quotePage |
The quote page. | Nothing: it needs no content. |
team |
The team block on the about page. | A published team member. |
emergency |
The emergency banner, the header link, the note on the contact page and the pill in the footer. | emergency.phone in the settings. |
carePlan |
The care plan block and its price. | carePlan in the settings, with a name and a price. |
fromPrices |
“From $X” on service cards and service pages. | A service with a from price. |
texts |
The text message consent line under phone fields. | smsConsent in the settings. |
The settings these parts need are on the Settings page.
What turns off with a part
An off part has:
- No page. Its addresses answer with the 404 page.
- No link, in the menus, the footer or any page.
- No home page section.
- No entry in the sitemap, the feed or site search.
- No share card.
Some parts leave something in their place:
- Areas off: town names stay, as plain text. Projects and reviews still show their place, with no link.
- Quote page off: quote buttons go to the contact page, with the picked services ticked.
- Team off: post bylines show the business name.
A link you wrote yourself that points at an off part, such as a button in the hero, shows no link.
The home page
A home page section of an off part does not show. content/home.yaml keeps it, so it comes back when you turn the part on. pnpm test:adapter lists each one as a warning, not an error. Delete it from content/home.yaml when you are sure you will not use the part.
The quote picker in the hero sends its picks to the quote page, or to the contact page while the quote page is off. With no form on that page, the picker is hidden, and pnpm test:adapter warns.
What each preset turns on
The base, on in every preset: projects, areas, posts, the quote page and the team.
| Preset | On beyond the base |
|---|---|
construction |
Nothing extra |
landscaping |
The care plan |
plumbing |
The emergency line, “from” prices |
cleaning |
The care plan, “from” prices |
texts is off in every preset. The preset is the preset line in src/theme.config.ts, not the sample you started from. If you change the preset, the defaults change with it. To keep a part as it is whatever the preset, set its switch to true or false. See Looks.
EmDash search
With EmDash, site search drops each hit of an off part. EmDash’s own search API, /_emdash/api/search, still answers for published entries of a part that is off. It is the CMS’s API, not a page of the theme. To keep an off part’s entries out of it, unpublish them.
Next: Looks.