Admin Panel Reference
The CWA admin panel is shipped as part of the layer and requires no setup. It becomes accessible at /_cwa for content admins, any user who reaches ROLE_CMS_ADMIN. The users pages need ROLE_USER_ADMIN instead, so a user admin on their own gets the admin header with only Users. See Admin Roles.
Admin Routes
This is the complete list of admin routes. The Admin Panel tours what an editor does with them.
| Route | Purpose |
|---|---|
/_cwa | Redirects to /_cwa/pages |
/_cwa/pages | Browse and create page records; assign each a layout and page template |
/_cwa/pages/[iri] | Page settings: SEO title and description, layout, Page UI (uiComponent), style and parent, with Routes and Info tabs |
/_cwa/layouts | Browse and create layout records |
/_cwa/layouts/[iri] | Edit a layout: its reference, Layout UI (uiComponent) and style |
/_cwa/routes | Manage routes: paths, redirects and the route tree |
/_cwa/routes/[iri] | A page's or page data record's routes: path, redirects and visibility (live, scheduled or not live; see The Admin Panel › Visibility) |
/_cwa/data | Lists the page data types (blog, products, events…) |
/_cwa/data/[type] | List and create records of one page data type |
/_cwa/data/[type]/[iri] | Edit one page data record |
/_cwa/users | List and create user accounts |
/_cwa/users/[iri] | Edit an individual user and their roles. Role sets a level: User, Content admin, User admin, Content and user admin, Admin, Admin and user admin, or Super admin, and saves only the roles that level stands for. Each extension admin page role shows as a toggle, named after the pages' labels; Admin and above have them all. You can't grant a role you don't have, or change your own role. Changing an existing user's Email shows Your current password: enter your own password, not the user's, to save the change. A wrong password shows under the field. The confirmation link goes to the new address, and the current address gets a notice (see User Emails › Email Address Change Flow). A pending email change shows Resend email verification (disabled with a countdown while throttled) and Cancel change, which clears the pending address so its emailed link stops working |
/_cwa/account | My account, from the header menu: change your own email (with your current password; resend or cancel a pending change, or resend the verification email while your address is unverified) and your password, and choose your Admin top bar shortcuts (see The Admin Top Bar). It opens for everyone the admin header shows for: content admins (ROLE_CMS_ADMIN), user admins (ROLE_USER_ADMIN) and anyone with the role of an extension admin page; anyone else is sent to /. Built from useCwaAccount, useCwaChangePassword and useCwaChangeEmail, so an app can build its own |
/_cwa/extensions | Extensions, from the header menu: the installed extensions the user can open, with each one's icon, label and description, linking to its area. See Extending the CWA › Admin Pages › The Extensions Page |
/_cwa/settings | Site config: name, SEO defaults, robots, sitemap, maintenance mode, and the orphaned resources scan |
/_cwa/orphaned | The last orphaned resource report: view and delete orphaned components, positions and groups. Opened from site settings, which can also start a scan. See Orphaned Resources. Its Files report lists orphaned, unknown, missing and invalid files; see Orphaned files |
An extension can add its own area under /_cwa, such as /_cwa/shop, with its pages as tabs. See Extending the CWA › Admin Pages › The Extension's Area.
The layer also registers /_cwa/[cwaPage0], which isn't an admin page. It renders a CWA resource by its IRI, for links built with getInternalResourceLink.
All /_cwa routes are client-only (SSR disabled). Every admin page under /_cwa uses the layer's cwa-admin route middleware, set on the /_cwa parent page and inherited by each admin page: a signed-out visitor is sent to /login?redirect=… and returned after sign-in, and a signed-in non-admin is sent to /. Signing out while on an admin route sends you back to /. To guard your own admin-only pages, use the same middleware — see Protecting Pages.
Linking to the add page data form
A link can open the add form for a page data type with its parent and template already chosen. The add form is /_cwa/data/<type>/add, where <type> is the class's short name with a lower-case first letter (App\Entity\TrainingModuleData → trainingModuleData). Add any of these query parameters:
| Query parameter | Fills in |
|---|---|
parentPage | The parent page, as a page IRI |
parentPageData | The parent page data, as a page data IRI. With parentPage as well, the parent page wins |
template | The template (the form's page field, shown as the Dynamic Page), as a page IRI |
For example, a course page can have an "Add a training module" button that opens the add form with the course as the parent and the training module template chosen:
<template>
<NuxtLink
:to="{
path: '/_cwa/data/trainingModuleData/add',
query: { parentPageData: courseIri, template: moduleTemplateIri },
}"
>
Add a training module
</NuxtLink>
</template>
Pass the query as an object, as here, so the IRIs are encoded for you.
template, never page.?page= is the page number of the list behind the form.- The route can't be filled in. The path isn't a page data field. After saving, the form opens the Routes tab, where you add it.
- The parameters only apply when adding. Opening an existing page data ignores them.
The Admin Top Bar
On an admin page, the middle of the admin header is a row of icons. The first is a house, always there, which takes you back to the site page you were on before you opened the admin, or to /. Shortcuts to admin areas follow it.
The shortcuts come from the first of these that's set:
- The admin's own choice. On My account › Admin top bar, each admin turns shortcuts on and off with a toggle, orders them with Move up and Move down, and goes back to the default with Reset to default. The choice is saved on their own user, as
adminPreferences, and only they see it. The section needs bundle 2.0.0-alpha.49 or later, and shows only when/mehas anadminPreferencesfield (see Authentication › Admin Preferences). - The site's default, set in
nuxt.config:export default defineNuxtConfig({ cwa: { admin: { topBar: ['pages', 'routes', 'ext:shop'], }, }, }) - The built-in default: Layouts, Pages, Data, Routes and Users, then each extension registered with
topBar: true(see Extending the CWA › Registering an Extension).
The ids are layouts, pages, data, routes, users, and ext:<area> for an extension, where <area> is its admin area's name in /_cwa/<area> (ext:shop for /_cwa/shop). Any extension with an icon and admin pages can be a shortcut. An id that names nothing gives a build warning and is left out, and a topBar that isn't a list of strings is ignored with a warning.
A list, the admin's or the site's, is complete: a shortcut it doesn't name stays off, including an extension installed later. Each admin sees only the shortcuts their roles can open, so a user admin on their own sees only Users.
Edit Mode
When an admin visits a content page, an edit bar appears at the top of the page (rendered by <CwaAdminHeader>). Clicking "Edit" toggles edit mode:
const cwa = useCwa()
cwa.admin.isEditing // whether edit mode is active (a reactive boolean, not a ref)
cwa.admin.toggleEdit() // open/close edit mode
In edit mode, every rendered component gains a selection overlay. Clicking a component opens its resource manager panel (<CwaAdminResourceManager>).
The edit bar also shows the other signed-in admins: an avatar for each one on this page, +N elsewhere for the rest, and a list of where each one is. Components and fields they have selected are outlined in their colour. See Real-Time Updates › Who Else Is Here.
The Resource Manager
The resource manager is a panel that slides in when a component is selected. It shows tabs for editing the component's data fields. The standard tabs (resource info, UI styles, publish, ordering) ship with the Nuxt module. Custom tabs are added using useCwaResourceManagerTab.
The panel's More actions menu, beside the publish button, adds a component before or after the selection, clones it into another place, and moves it. A clone is the same component, with the same IRI, never a copy; a move takes the selected instance out of its place. See The Admin Panel › Cloning a Component and The Admin Panel › Moving a Component. A component used in more than one place shows a Shared · N places badge beside the publish button, see The Admin Panel › Shared Components.
Custom Manager Tab
Create a Vue component in app/app/cwa/components/[ComponentName]/admin/[TabName].vue. Use useCwaResourceManagerTab to register it:
<!-- app/app/cwa/components/Title/admin/SEO.vue -->
<template>
<CwaUiManagerTab>
<CwaUiInput
field="metaTitle"
label="Meta title"
placeholder="Override page title for search engines"
width="lg"
/>
</CwaUiManagerTab>
</template>
<script setup lang="ts">
import { useCwaResourceManagerTab } from '#imports'
const { exposeMeta } = useCwaResourceManagerTab({ name: 'SEO', order: 10 })
defineExpose(exposeMeta) </script>
defineExpose(exposeMeta) is required — without it the tab has no name and won't be ordered. A field given field saves to the selected component, so the tab needs no iri prop of its own.The tab appears in the resource manager whenever a Title component is selected.
cwa.admin API
Edit mode, the selection stack and the navigation guard are controlled through cwa.admin. Its members are listed in cwa.admin.
Navigation Guard
While edit mode is on, the module blocks programmatic navigation, <NuxtLink> clicks included, so an edit in progress isn't lost. cwa.admin › Navigation Guard covers what is blocked, the ?cwa_force=true bypass and setNavigationGuardDisabled().
Navigating away while a component is being added opens a dialog asking whether to discard it. See cwa.admin › Navigation Guard.