Every route of the player site is wrapped in a
ViewTemplate(client/src/routes/index.tsx,client/src/pages/PublicPage.tsx); thesample-sectionssample replacessite.home.
A template is a React component for one whole screen. A view id is the host-owned name of that screen. A theme registers templates under view ids; the host picks the most specific template it finds and falls back to default for everything else. Routes stay host-owned: a theme never adds a URL, it provides the screen for one that exists. The one namespace a theme can fill beyond the host’s own pages is an active plugin’s /ext/<providerType>/… (contract 0.2.0, below), and that namespace belongs to the plugin.
The hierarchy
Ids are dotted, lowercase, most specific last. When no template is registered for the full id, the host drops the last segment and tries again, until it reaches the namespace root and then default.
site.home front page
site.page.<template> → site.page template ∈ default | full-width | sidebar-left | sidebar-right | landing | blank
site.blog.index · site.blog.post · site.blog.category · site.blog.tag · site.blog.author · site.search → site.blog
site.auth.login | register | forgot | reset | verify → site.auth
member.lobby.cash | tournaments | private → member.lobby
member.tournament.detail
member.cashier
member.security → member.profile /profile?tab=password|security
member.profile every other /profile tab
member.settings
member.history · member.hand · member.notifications
member.leaderboard · member.affiliate
member.plugin.<providerType>.<segment>… → member.plugin.<providerType> /ext/<providerType>/<path>, only while the plugin is active
member.player /players/:username (public profile)
agent.overview · agent.players · agent.player · agent.sub-agents · agent.clubs · agent.club
agent.commissions · agent.wholesale · agent.reports
table.<mode>.<variant> → table.<mode> → table.<variant> → table
site.notfound
Notes fixed by the design:
site.blog.*andsite.searchare defined so themes can prepare for them, but the blog is separate, later work.- The cashier tabs (deposit, withdraw, transfer, history, verification) are resolved inside
member.cashierby its controller, not by separate view ids, and so are the profile tabs insidemember.profile. The one exception: the profile’spasswordandsecuritytabs trymember.securityfirst and fall back tomember.profile, so a theme can replace the security screen alone, or own every profile tab throughmember.profile. - Maintenance is not a view id. The maintenance overlay stays host-owned.
- The reserved ids (
site.blog.*,site.search) have no host page yet. A template registered for one is accepted but never renders. - Every agent portal route has its own
agent.<page>id. Agent ids have no shared parent, so a template registered foragent.playersdoes not coveragent.player.agent.stays an open prefix for agent pages added later. table.*ids resolve to the host’s table page; a theme changes the table through a layout, not a template (see Table Layouts).- Plugin pages (contract 0.2.0):
/ext/<providerType>/<path>triesmember.plugin.<providerType>plus one segment per path segment (up to four, stopping at the first segment that is not a lowercase id segment), most specific first:/ext/social/friends/requeststriesmember.plugin.social.friends.requests, thenmember.plugin.social.friends, thenmember.plugin.social. A template renders only while the plugin is active, also where the plugin registered no client page of its own; with the plugin inactive, or no template, the plugin’s own page renders as before, and a page redirect the plugin declares wins. See Using Plugin Data in a Theme.
The lists are VIEW_IDS, RESERVED_VIEW_IDS and OPEN_VIEW_ID_PREFIXES in src/themes/ids.ts; client/src/themes/default/registrations.ts records where default fills each one.
Namespaces
| Namespace | Screens |
|---|---|
site | Public pages: home, CMS pages, auth, blog, search, not found |
member | Signed-in player pages: lobby, tournament detail, cashier, profile, security, settings, hand history and replay, notifications, leaderboard, affiliate, plugin pages |
table | The poker table, by mode and variant |
agent | The agent portal: overview, players, sub-agents, clubs, commissions, wholesale, reports |
How a template receives data
A template receives two props: viewId, the id that matched, and params, the route parameters as strings (for example { tournamentId } on member.tournament.detail, { tab } on the lobby). Everything else comes from SDK hooks: useViewer, useLobby, usePage, useMenu, useThemeSettings, useT, and useLocation or useMatch(pattern) for the current route (query string and hash included). A template never reads a store, location or the API.
A template that replaces a page with plugin slots places them with the SDK Slot in the same spots (<Slot id="lobby.top" />, <Slot id="auth.login.below-form" />, <Slot id="cashier.deposit.method-list" passProps={{ selectedMethod, amount }} />), so a plugin’s additions survive the theme. The list of slots is in Parts and Part Areas › Plugin slots.
A member page’s behaviour comes from its controller: a host-owned hook, useXController(), that returns { view, commands, status, errors }. The default page runs the same hook, so a template that renders the controller behaves like the product. The controllers and their fields are listed in Member and Auth Controllers. The table below shows which controller serves which view id.
| Route | View id | Controller |
|---|---|---|
/lobby, /lobby/cash-games | member.lobby.cash → member.lobby | useLobbyController() |
/lobby/tournaments | member.lobby.tournaments → member.lobby | useLobbyController() |
/lobby/private-games | member.lobby.private → member.lobby | useLobbyController() |
/tournament/:tournamentId | member.tournament.detail | useTournamentController(params.tournamentId) |
/history | member.history | useHandHistoryController() |
/history/:gameId | member.hand | useHandReplayController(params.gameId) |
/notifications | member.notifications | useNotificationsController() |
/leaderboard | member.leaderboard | useLeaderboardController() |
/affiliate | member.affiliate | useAffiliateController() |
/players/:username | member.player | none yet (not yet supported): the public player profile renders the default page; it places profile.header.badges, profile.actions, profile.stats.after and profile.tabs with isOwnProfile |
/agent | agent.overview | useAgentController() |
/agent/players, /agent/players/:id, /agent/sub-agents, /agent/clubs, /agent/clubs/:id, /agent/commissions, /agent/wholesale, /agent/reports | agent.players, agent.player, agent.sub-agents, agent.clubs, agent.club, agent.commissions, agent.wholesale, agent.reports | none yet (not yet supported) |
/login, /register, /forgot-password, /reset-password, /verify-email, /register/complete | site.auth.login, .register, .forgot, .reset, .verify, .complete | useLoginController(), useRegisterController(), useForgotPasswordController(), useResetPasswordController(), useVerifyEmailController(), useCompleteSignupController() |
/cashier | member.cashier | useCashierController(), plus CashierMethodForm for payment-plugin fields |
/profile | member.profile | useProfileController(); the protection tab uses useProtectionController() |
/profile?tab=password|security | member.security → member.profile | useSecurityController() |
/settings | member.settings | useSettingsController() |
/ext/:providerType/* | member.plugin.<providerType>[.<segment>…] → member.plugin.<providerType> | none: the plugin owns the page; a template reads the plugin with usePluginQuery, usePluginAction and usePluginEvent (Using Plugin Data) and receives params.providerType and params.path |
For the lobby, a theme that only wants to restyle rows and filters can still fill the lobby.* part areas instead of replacing the whole view.
The template sits inside the route’s guards: member.profile, member.cashier and the other signed-in pages stay behind RequireAuth, so a template never bypasses sign-in.
Registering a template
Register the template under views in defineTheme, and list the id under views in the manifest:
defineTheme({
slug: 'sample-sections',
views: { 'site.home': () => import('./templates/home') },
});
"views": { "site.home": {} }
Written as () => import('./file'), the template is its own lazy chunk, so the entry bundle stays small; the module’s default export is the component. The host renders it inside the theme error boundary with the default page as the fallback, wrapped in <div data-pe-view="<id>" data-pe-theme="<slug>" class="contents">. If the template throws, the whole theme is deactivated for the session and the player sees default, without a reload.
Part areas inside templates
A template that replaces a screen still renders the host’s part areas where the design expects them, so that plugin fills and operator menus are not lost. See Parts and Part Areas.
Public templates and SEO markup
Public templates (site.*) should have exactly one <h1>, landmarks, alt text from section settings, real text rather than text inside images in hero and call-to-action sections, and links through the SDK Link. The validator checks one of these today, as a warning (seo.section-text, a hero or call-to-action default without text); the other markup checks are not yet supported. The end-to-end suite’s accessibility check (axe) covers the pages it visits.