Page navigation and routing
Page navigation connects the Builder dashboard, page editor, site settings, and preview surfaces. It gives each authored page an editor URL and a public route, then uses page state to move between those surfaces without losing the page being edited.
Navigation model
The Builder has two route spaces. The application route opens an authoring surface such as the dashboard or editor. The page route identifies the website URL that the authored page will serve. A page record joins these spaces through its page name and route.
The main authoring flow is:
flowchart LR
D[Dashboard] -->|select page| E[Page builder]
E -->|Preview| P[Preview surface]
P -->|Back to builder| E
E -->|Back to dashboard| D
E -->|View published page| W[Website route]
D -->|Global settings| S[Site settings]
S -->|Homepage and redirects| W
The dashboard and editor are protected authoring routes. The website route is resolved by the server from published page routes, including dynamic routes when a path contains a variable. The broader workspace that hosts these surfaces is described in Visual builder workspace, while the editor surfaces are explained in Editor canvas interaction, Block composition system, and Property and style editing.
Builder application routes
Route set
The frontend uses a base path supplied by the site, which defaults to /builder. Within that base path, named routes keep navigation stable even when the visible URL changes.
| Surface | Application path | Purpose |
|---|---|---|
| Dashboard | / | Browse and manage authored pages. |
| Dashboard view | /dashboard/:item/:path(.*)* | Open a selected dashboard view while keeping the dashboard shell. |
| Page builder | /page/:pageId | Edit one page or create a new page. |
| Page preview | /page/:pageId/preview | View the page in a resizable browser frame. |
| Persona survey | /persona-survey | Guide optional onboarding questions to a template, blank page, or site-clone starting point. |
| Compatibility paths | /home, /page | Redirect older entry paths to the current dashboard flow. |
The router loads the dashboard, builder, and preview surfaces only when their routes are visited. Dashboard views use the dashboard shell while carrying the selected view in the URL. In the normal application, authoring routes use the Builder base path and permission gate. A demo editor can use a limited /demo/:pageId route instead, with the named builder route kept for editor links.
References: frontend/…/router.ts• L62-124 frontend/…/PageBuilderDashboard.vue• L1-19
Access gate
Every normal authoring route checks whether the visitor has write permission for the Builder Page record. A logged-in user without permission returns to Desk, while a visitor who is not logged in is sent to login with the Builder path as the return target.
The demo editor is a separate constrained mode. It accepts only the configured demo page and does not use the normal application route list or permission gate.
This gate is separate from page access. A user may have permission to edit pages while a published page still limits website viewing to logged-in users.
References: frontend/…/router.ts• L8-49 frontend/…/router.ts• L116-124 builder/hooks.py• L198-227 builder/…/builder_page.py• L64-88
Onboarding survey
The persona survey is an optional onboarding path inside the authoring route space. On supported Cloud sites, the dashboard sends a logged-in author to it when the survey is not complete. A development query can force this route for testing without changing the normal completion rule.
The survey asks about the author's role, intended use, and discovery source. After the questions, it offers three ways to start: copy an existing site, choose a template, or open a blank page. Authors can move back through the questions or skip them before choosing a start path.
The selected use case can set the template gallery's starting category. A blank page opens the normal new-page builder route. A template keeps the author in the gallery until a template choice moves into page creation. Site copying starts a server task and shows progress before the author returns to the dashboard. This makes onboarding a route into page creation rather than a separate editing system.
References: frontend/…/PageBuilderDashboard.vue• L20-47 frontend/…/PagePersonaSurvey.vue• L1-107 frontend/…/PagePersonaSurvey.vue• L128-221 frontend/…/PagePersonaSurvey.vue• L280-370 frontend/…/TemplateGallery.vue• L157-184 frontend/…/TemplateGallery.vue• L186-240
Page discovery
Dashboard views
The dashboard is the page entry point for authors. It presents non-template pages as cards or list rows, and it supports search by page title or route, status filters, sort order, folders, selection, and page actions.
The grid and list views emphasize page identity and preview imagery. Published pages show their public status, and page actions provide the common lifecycle operations: duplicate, view, unpublish, open in Desk, or delete when allowed. Selecting a card or row opens the named builder route for that page by using its page name as the route identifier.
Dashboard views add URL-addressable areas to the same shell. They let navigation preserve the selected dashboard area without changing the page authoring model.
References: frontend/…/PageBuilderDashboard.vue• L1-19 frontend/…/DashboardContent.vue• L1-50 frontend/…/DashboardHead.vue• L1-95 frontend/…/PageCard.vue• L1-46 frontend/…/PageListItem.vue• L1-64 frontend/…/PageActionsDropdown.vue• L1-35 frontend/…/router.ts• L80-85
Route tree
The route tree shows page URLs as a hierarchy. Each path segment becomes a node, so related routes appear below shared path segments even when an intermediate segment has no page of its own.
The tree supports search, folder filtering, expand and collapse controls, incremental loading for large branches, and keyboard movement. Activating a node that represents a page opens that page in the builder. A node without a page acts as a path group rather than an authoring target.
The tree marks the homepage, limited-access pages, and unpublished pages so an author can understand site coverage before opening a page.
The tree opens the same editor used by page cards and list rows. Once inside that editor, authors can use the shared asset and block template resources without changing the page route.
References: frontend/…/RouteTreeView.vue• L59-121 frontend/…/RouteTreeView.vue• L136-212 frontend/…/RouteTreeView.vue• L227-285 frontend/…/RouteTreeNode.vue• L31-68
Page identity and options
Route identity
Each page has a display title and a route. The title helps authors find the page. The route is the website path and is also the key used to place the page in the route tree.
A route can contain a dynamic variable such as /users/:id. The editor detects these variables and shows fields for sample values. Those values let the author inspect page data and open a resolved page URL without changing the route pattern.
When a page is loaded, its route variables are restored for that page and can be updated from the page options. The same resolved values are passed to page data and preview requests, so the editor and preview represent the same route case.
References: frontend/…/PageOptions.vue• L3-32 frontend/…/PageTitlePopover.vue• L38-77 frontend/…/pageStore.ts• L39-75 frontend/…/pageStore.ts• L376-410
Page access and publishing
Page options control how a page behaves as a website entry point. Authors can publish or unpublish the page, set it as the homepage, restrict it to logged-in users, disable search indexing, and place it in a project folder.
The homepage is a site-level route choice. The page editor can set or clear it for the current page, while global settings select from published, non-dynamic page routes. A protected page cannot be the homepage because the homepage must remain the public site entry point.
Publishing makes the page available to the website renderer. Unpublishing removes that availability and clears the homepage choice when the unpublished page was the homepage.
References: frontend/…/PageGeneral.vue• L20-59 frontend/…/PageGeneral.vue• L91-127 frontend/…/GlobalGeneral.vue• L1-24 frontend/…/pageStore.ts• L189-203 builder/…/builder_page.py• L207-228
Page metadata
Page options also include the browser-facing title, preview or metadata image, description, canonical URL, language, and favicon. These values describe the public page and are distinct from the editor route used to open the page in Builder.
The public renderer uses the page route to resolve the request. It uses the page metadata to build the response and uses the canonical URL to identify the preferred public address when one is set.
Route options describe the page shell, not the content inside it. Content changes continue through the block composition system and property and style editing, while page scripts and data remain covered by client-side code and data blocks.
References: frontend/…/PageMeta.vue• L1-43 frontend/…/PageGeneral.vue• L61-90 builder/…/builder_page.py• L90-100 builder/…/builder_page.py• L524-533
Redirect management
Redirect rules
Global redirects map an old source path to a target path. The target can be another site path or an external URL. Authors can choose permanent or temporary HTTP redirect status and can preserve the original query string when the target needs it.
Redirects belong to the site settings rather than to an individual Builder Page. This lets one rule cover a path after a page is renamed or moved, while the page record remains responsible for its current route.
References: frontend/…/GlobalRedirects.vue• L14-29 frontend/…/GlobalRedirects.vue• L66-121 frontend/…/GlobalRedirects.vue• L220-282 frontend/…/routeRedirects.ts• L1-14
Route resolution
The website resolver first looks for a page with an exact path. If no exact page exists, it checks published pages marked as dynamic and matches their route pattern. The resolver then gives the matching page to the public page renderer, which checks access before producing the response.
Route changes, publication changes, and dynamic-route changes clear the route cache. This keeps a new route from being hidden behind an older resolution result.
References: builder/hooks.py• L204-214 builder/…/builder_page.py• L64-88 builder/…/builder_page.py• L207-250 builder/…/builder_page.py• L1732-1754
Preview surfaces
In-editor preview
The preview surface keeps the authoring controls outside the page and renders the page inside an iframe. It supports desktop, tablet, and mobile widths, a custom width between those presets, and a dark-mode switch for the page being previewed rather than for the Builder interface. A preview opened from the editor can return to that editor or detach into a separate tab.
Preview requests use the selected page and its current route-variable values. The server renders draft content for this preview, so an author can inspect changes before publishing. The preview surface provides a direct path back to the same builder page and supports Escape as a back action. A detached or bookmarked preview loads the page and route variables itself when no editor has already selected them.
While the preview is active, it watches updates for the selected Builder Page and rebuilds its preview URL after a page save. If no editor tab is present, it also refreshes the page store when the saved document changes. An editor tab keeps ownership of its own realtime session, while a standalone preview removes its subscription when it closes.
References: frontend/…/PagePreview.vue• L1-73 frontend/…/PagePreview.vue• L99-180 frontend/…/PagePreview.vue• L200-251 frontend/…/PagePreview.vue• L306-371 builder/…/builder_page.py• L477-515
Published page view
The dashboard and page title controls can open a published page in a named browser window. The URL is built from the page route and replaces dynamic variables with the current sample values.
This view answers a different question from the iframe preview: it checks the public website route after publication. The action is available only for published pages, while the in-editor preview remains the place to inspect a draft.
Preview does not replace the editor's draft state or history. Those concerns remain in Editing state and history.
References: frontend/…/PageActionsDropdown.vue• L13-24 frontend/…/PageTitlePopover.vue• L31-35 frontend/…/pageStore.ts• L189-203 frontend/…/pageStore.ts• L396-424
Authoring surface navigation
Dashboard-to-builder navigation
Page cards, list rows, route-tree nodes, and search results all navigate to the named builder route with the page name as its identifier. The builder then loads the selected page record and places its content in the canvas.
The command palette adds a fast path for this same movement. It searches page title, page name, and route, and it keeps a short recent-page list in browser storage. When navigation happens while the builder is already active, the reused editor closes the prior realtime document session, opens the new one, and updates the page store so it shows the new page rather than the old canvas.
References: frontend/…/PageCard.vue• L1-3 frontend/…/PageListItem.vue• L1-3 frontend/…/RouteTreeView.vue• L227-237 frontend/…/BuilderCommandPalette.vue• L164-231 frontend/…/PageBuilder.vue• L257-291
Builder navigation
The builder toolbar exposes page settings and preview. The main menu returns to the dashboard, starts a new page flow, opens templates, and exposes page-level actions. The page title control links the title and route to the page options so route changes stay close to the active page identity.
The same editor can enter a fragment mode for editing a reusable component. Its breadcrumb returns to the page surface, and its save action returns to the page after the fragment change is applied. This keeps component authoring inside the page context without creating a separate page route.
The builder also supports a new page identifier as a creation entry point. It creates a starter page, then replaces that temporary route with the saved page name so later navigation uses the page's stable identity. If the active builder is reused for another page, it closes the old realtime document session before it loads the new page into the canvas. This handoff also covers links from the editor to another page, so the address bar and the visible canvas stay aligned.
The fragment surface therefore shares the canvas and content model described in Editor canvas interaction and Block composition system, rather than creating a second navigation model.
References: frontend/…/MainMenu.vue• L46-119 frontend/…/ToolbarActions.vue• L1-15 frontend/…/PageTitlePopover.vue• L2-43 frontend/…/PageBuilder.vue• L37-51 frontend/…/PageBuilder.vue• L217-224 frontend/…/PageBuilder.vue• L257-319
Settings navigation
Settings use one dialog with page-level and global groups. Page settings describe the active page. Global settings describe site-wide behavior such as the homepage and redirects. The dialog remembers the selected settings tab and can be opened in a global-only mode.
When a settings surface is opened for a page route, it keeps the active page aligned with that route. This prevents a settings panel from showing one page while the URL identifies another.
References: frontend/…/BuilderSettings.vue• L1-37 frontend/…/BuilderSettings.vue• L40-119 frontend/…/GlobalGeneral.vue• L85-109
Change checklist
When these files or sections are changed, remember to consider these:
- Keep the named frontend routes, route links, and page-loading behavior aligned. A route can change in the address bar while the reused builder still shows the prior page if the page-load handoff is missed.
- Treat the page route as a shared contract between page options, route-tree grouping, dynamic-route matching, homepage selection, preview URL creation, and public URL creation.
- Keep dynamic route variables consistent between the editor sample values, page-data requests, preview requests, and links that open the published page.
- When changing publication or access rules, check both the dashboard status cues and the server-side public access check.
- When changing redirects, preserve the child-row fields expected by Website Settings and the HTTP behavior represented by status and query forwarding.
- When changing the Builder base path, check router history, login return paths, editor links, and the server route rules together.
- When changing dashboard views, keep the dashboard shell and URL parameters aligned so a selected view opens the intended dashboard area.
- When changing demo routing, keep the constrained page match and the named builder link contract aligned.
- When changing onboarding answers or start choices, keep survey completion, category filtering, blank-page routing, template selection, and site-clone progress aligned.
- When changing preview theme behavior, keep the preview request's color-scheme value aligned with the iframe document state.
- When changing preview refresh behavior, keep the page-save event filter aligned with the preview page identifier and leave realtime session ownership with the builder surface.
- When changing standalone preview behavior, keep page loading, route-variable restoration, editor-tab detection, and subscription cleanup aligned.
- When changing the
newbuilder route, keep starter-page creation and replacement of the temporary route with the saved page name in one flow.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| A page route changes without route-cache invalidation | The public site can resolve the old route or miss the new route | Clear route caches when route, publication, dynamic-route, or related render state changes. |
| A dynamic route has no sample value | Preview and public-page links keep the route placeholder and may not represent a usable page | Set route variables before previewing or opening a page in the browser. |
| A protected page is selected as the homepage | The main site entry would require login | The page options disable protection for the homepage, and global homepage choices exclude dynamic routes. |
| Builder navigation changes only the URL while the editor component is reused | The canvas and realtime document can remain attached to the previous page | Update the page store and close the prior document subscription when the page identifier changes. |
| A dashboard view is added without matching route parameters | A bookmarked dashboard URL can open the wrong area or lose its selected context | Keep the dashboard shell's view state mapped to the dashboard-item route. |
| Demo navigation accepts a page other than the configured demo page | A restricted demo can expose or edit an unintended page | Limit the demo guard to the configured page identifier. |
| A redirect target or source is saved with incomplete fields | The site receives an invalid or ineffective redirect rule | Require both source and target before saving and keep the redirect row fields mapped to Website Route Redirect. |
| An unpublished page is opened through its public route | The page is not available as a normal public website response | Use the editor preview for draft inspection and publish before using the public-page view. |
| The builder is opened on a screen below the supported editing size | The page route loads without a usable editing canvas | Move to a larger screen before editing; the builder blocks the editing surface on small screens. |
| Survey completion is not marked before navigation | Returning to the dashboard can send the author back into onboarding | Mark the survey complete before moving to the blank-page, template, clone, or dashboard flow, without making navigation depend on the save or telemetry request. |
| A page is saved while its preview is active but the preview does not refresh | The iframe shows older draft content until the author reloads it | Keep the Builder Page update listener tied to the active page and rebuild the preview URL after the save event. |
| A standalone preview does not load its own page state | A bookmarked or detached preview can show stale route variables or fail to represent the selected page | Load the page identity and route variables when no matching active page is present, then sync the store when the document changes. |
Key files
| File | Why to read it |
|---|---|
| frontend/…/router.ts | Defines the authoring route space, dashboard views, demo mode, base path, redirects, and permission gate. |
| frontend/…/PageBuilderDashboard.vue | Shows the dashboard shell and the entry point for page discovery and onboarding routing. |
| frontend/…/PageBuilder.vue | Shows the active page editor, fragment return path, page creation entry point, and page handoff when a reused builder route changes its page identifier. |
| frontend/…/PagePersonaSurvey.vue | Shows the optional onboarding path from survey answers to blank-page, template, and site-clone starting surfaces. |
| frontend/…/DashboardContent.vue | Connects dashboard filters and views to page navigation. |
| frontend/…/PageCard.vue | Shows how a dashboard card opens the builder for its page. |
| frontend/…/PageListItem.vue | Shows how a dashboard list row opens the builder and exposes page identity. |
| frontend/…/RouteTreeView.vue | Explains how website routes become a navigable hierarchy. |
| frontend/…/pageStore.ts | Connects page selection, route variables, public URLs, publishing, and page loading. |
| frontend/…/PageOptions.vue | Shows the compact route and dynamic-variable controls in the builder. |
| frontend/…/PageGeneral.vue | Shows page publication, homepage, access, indexing, and folder choices. |
| frontend/…/GlobalGeneral.vue | Shows the site-level homepage contract. |
| frontend/…/GlobalRedirects.vue | Shows site-wide redirect authoring and HTTP options. |
| frontend/…/PagePreview.vue | Defines the draft preview surface, route-variable request, page color-scheme behavior, editor-tab return path, and refresh on page saves. |
| builder/…/builder_page.py | Defines public route resolution, access checks, cache behavior, and rendered page URLs. |
| builder/hooks.py | Connects the Builder application path and public page resolver to the Frappe website runtime. |