- Statistics view: the browser-tab title follows the admin language.
Payload's custom-view meta.title is one plain string and its custom-view
metadata ignores i18n, so the view renders <DocumentTitle> (/admin) with the
translated title; it re-applies the title while the view is open because
Next streams the English metadata in after hydration. adminDocumentTitle()
adds admin.meta.titleSuffix the way Payload does.
- Cookie scanner: CookieIntegration.label may be { en, pl, ... }. The built-in
names without a product name come from the shared admin texts
(cookieIntegration*, cookieSourceProject); the scan endpoint answers in the
request's admin language and stored source names use the scanning editor's.
- Maintenance notice: getConstructionMode(locale) returns `locale`; the "x"
close button gets a screen-reader name "Close" / "Zamknij" (locale and
closeLabel props; constructionCloseLabel exported).
- Favicon: FaviconCheck (/admin, afterInput on Site settings -> Site icon)
warns in the admin language when the image is under 48x48 or not square,
without blocking the save; validateFaviconField shares faviconProblems().
- Docs, AGENT.md and skills: the above, plus Next.js 16.4.1 or later as the
minimum safe version (AGENT.md 4.11, ipal-setup, ipal-upgrade).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
5.7 KiB
Under construction (developer tool)
A mode for a site that is not ready yet: visitors see only the home page and selected subpages (e.g. a brief), and everything else is blocked — no code changes, one switch in the admin panel.
Panel
Site settings → Maintenance (the tab is there when the pages module is on):
| Field | Meaning |
|---|---|
| Site under construction | turns the mode on |
| Pages still available | pages that still open; the home page is always available |
| Notice title / text / Close button label | popup content (per language); empty button → × with a screen-reader name in the page language ("Close" / "Zamknij") |
Fields in the SiteSettings global: group construction → enabled, allowedPages (relationship to the pages
collection, hasMany), title, message, buttonLabel (localized).
The page list and texts show only after the switch is checked. Turning the mode off restores normal site behaviour.
How it works
- An address not on the list (also a non-existent one) → redirect to the home page in that language with
?notice=construction(createPageRoutewith theredirectoption). Allowed pages are counted in every language (/pl/briefand/en/project-brief), so the language switcher works. - Clicking a link to a page not on the list →
<ConstructionNotice>cancels the navigation (beforenext/link) and shows the popup. External links, anchors on the same page,target="_blank"and modifier clicks (Ctrl/⌘) work normally. - After the redirect the popup opens once, and the parameter disappears from the address bar.
- Markdown and MCP from
createContentHelpers(markdownRoute,mcpPOST) hide the same pages:/md/…→ 404,list_pages/search_contentdo not show them,get_page→ "No page found". Your owncreateSearchRoute/createMcpRoute/createMarkdownRoute→ passisPathVisiblefromlib/content(createSearchRoute({ …, isPathVisible })). - Sitemap and llms.txt from
createContentHelperslist only the pages still open (optionunderConstructionSeo, defaulttrue;falselists everything). Hidden pages redirect to the home notice, which crawlers would otherwise index. - The proxy does not check the mode — that would need a database query on every request; the blocking is done by routes that read content anyway (page, Markdown, MCP, search, sitemap, llms.txt).
Building blocks
import { isPathVisibleIn, pathOf } from '@intecion/ipal-kit'
isPathVisibleIn(await getConstructionMode(locale), '/pl/o-nas') // false when the mode hides the page
pathOf('https://acme.pl/pl/o-nas?x=1') // '/pl/o-nas' — path from a result URL
isPathVisible(path, locale) from createContentHelpers = the same with the mode read for you (type PathVisibility).
Wiring in the project
// app/(frontend)/[locale]/[[...slug]]/page.tsx — redirect turns on address blocking
import { notFound, permanentRedirect, redirect } from 'next/navigation'
const route = createPageRoute(content, { blocks: blockRegistry, notFound, permanentRedirect, redirect })
// app/(frontend)/[locale]/layout.tsx — popup + link interception (no styles, classNames)
import { ConstructionNotice } from '@intecion/ipal-kit/client'
<ConstructionNotice
mode={await getConstructionMode(locale)} // from lib/content (createContentHelpers)
classNames={{ overlay: '…', dialog: '…', title: '…', message: '…', button: '…' }}
/>
getConstructionMode(locale) returns { enabled, allowedPaths, homePath, texts } (type
ConstructionMode). Pure logic: isPathAllowed(pathname, allowedPaths),
constructionNoticeHref(homePath), the constant CONSTRUCTION_NOTICE_PARAM (@intecion/ipal-kit).
New fields in Site settings = a migration in the project (payload migrate:create).
Turn off, override, extend
- Turn off: the Maintenance mode switch in the admin panel. The Maintenance tab is
currently always added when the
pagesmodule is on (there is no separate option). WithoutredirectincreatePageRouteaddresses are not blocked; without<ConstructionNotice>links are not intercepted. Markdown / MCP without the filter even with the mode on:createContentHelpers({ markdown: { isPathVisible: () => true }, mcp: { isPathVisible: () => true } }); sitemap / llms.txt without the filter:createContentHelpers({ underConstructionSeo: false }). - Override: the
×button's screen-reader name throughcloseLabel(default bylocale, which defaults tomode.localefromgetConstructionMode(locale);constructionCloseLabel(locale)is the default); popup look throughclassNames(overlay,dialog,title,message,button); texts in the admin panel. Your own rule = your ownisPathVisiblefunction in the options above or increateSearchRoute. Access/hooks of the Site settings global:ipalKit({ globalOverrides: { 'site-settings': … } }). - Extend:
getConstructionMode(locale)+isPathVisibleIn/isPathAllowed/pathOf/constructionNoticeHreflet you add blocking in your own routes. - Check: mode on →
/md/pl/<hidden>= 404, MCPget_page= "No page found",list_pagesdoes not show it, the sitemap does not list it. - One rule for all visitors — pages stay static (ISR), with no session check. Saving Site settings
revalidates the whole site only when the project passes
ipalKit({ revalidatePath })(see hooks.md); without it, already rendered/cached pages show the old state until the ISR window ends. - What is not blocked: the Payload API, the project's own routes that do not pass
isPathVisible, and your own search route withoutisPathVisible— the content of "hidden" pages can still be read from them.