DocsTheme structure & publishing
On this page

Add custom admin pages

Declare a menu and link protected management pages.

Build management screens that fit your theme: shipment operations, product catalogs, bookings, memberships or account management. Frontbacked adds your menu to fb-admin, while your pages use familiar HTML, CSS and FQL.

Declare the Menu

Create backend/admin.json inside your theme's source root. No version field is needed.

json

root is an absolute folder path within the theme, even when your theme lives in a nested repository folder. Each page is a relative HTML path beneath that folder. Pages appear in declaration order under Data → Manage Site, as the first menu option. The location and parent label stay the same across themes. The menu controls sidebar links only. Other HTML pages anywhere beneath root can open through links without a menu entry. There is no hidden field.

Use a dedicated folder such as /admin or /operations/admin. Do not use /, backend, assets, skins, upload folders or Frontbacked's reserved API/admin routes. Paths cannot contain traversal, query strings or external addresses. Labels and page counts are bounded; unknown configuration keys and duplicate page paths are rejected.

Set the optional home to the page administrators should see when opening fb-admin. Like menu pages, it is an HTML path relative to root; it does not need a menu entry. Without home, Frontbacked uses index.html inside the admin folder, then index.htm, then the first menu page. An explicit homepage should exist in the theme version you publish. Nested theme roots work the same way.

Analytics shows the standard site overview. Themes without management pages open Analytics by default.

A theme without this file keeps Manage Site in the same location, with a Manage content link to the standard post editor.

Permissions

All signed-in site administrators can see the menu and open HTML pages at any depth inside the admin root. admin.json declares navigation only; it has no permission field. Enforce data access and writes in FRL:

backend/index.frl
Rule input (JSON)

Use a complete version 2 rule file. Select a post with “postType” and “action”, or an “endpoint” by name. Saved data, jobs, payments and email need the local server. Dedupe replay protection also needs a site.

Check complete rules or run schemas, permissions, hooks and calculations against the input above. Add excerpts to a complete rule before running.

Custom pages use the signed-in administrator's account. They cannot bypass FRL validation or run requests as the system. Permissions are checked again on each request, so removing an administrator's access takes effect without relying on the sidebar.

Write the Pages

Put ordinary HTML pages inside your declared folder. Load the published Frontbacked script, then register your theme functions before calling Frontbacked.init().

Use FQL state for form inputs, queries, validation messages, conditional sections and repeated records. Use Frontbacked.createPost, updatePost, deletePost, and endpoints.call for operations. File values in post data use the normal upload flow. Use Frontbacked.state.check() with Frontbacked.schemas.post() for early form feedback; the server still validates the submitted post.

Admin pages receive their post validation schemas, including private fields. Private values are still excluded from ordinary FQL post reads. To edit private values, declare an FRL endpoint that checks the necessary admin permissions and explicitly returns only the needed fields. The shipping theme demonstrates this pattern.

Shared public HTML components use the same f-replace="/components/form.html" pattern as storefront pages.

Place shared CSS, scripts, images and fonts in public asset paths such as /assets. The declared admin folder is protected from public browsing; use it for your management HTML pages. Public and admin HTML components can be imported with FQL. Components inside your admin folder are available only to authenticated management pages. Third-party scripts are not enabled in the embedded pages; the Frontbacked CDN and the site's own scripts are supported.

Use relative or root-relative links to other HTML pages within your admin root:

index.html

Frontbacked opens the destination inside fb-admin.

The admin navbar provides a Back button. Add a Back link above the heading on detail, create and edit pages too, so administrators can easily return from pages outside the sidebar menu. Use data-admin-back to return to the page that opened the current page, keeping its query parameters. The href provides a fallback for direct visits. Use the same attribute for a form's Cancel link. Keep the management menu in backend/admin.json; do not repeat it inside your page.

index.html

Query parameters are exposed as $params in FQL and window.$params in theme JavaScript:

index.html

Use $query or $params for management-page query parameters; both receive the source page’s URL parameters. Linked pages do not need menu entries. Their paths must stay within the declared admin root; missing pages show a page-not-found message. Page sources come from the site’s selected theme version.

For action visibility, the page also receives window.$themeAdmin.capabilities, keyed by post type, with read, create, edit and delete booleans. The same values are available in FQL as $params.adminCapabilities, for example $params.adminCapabilities.shipments.edit. Use them directly in state or visibility bindings. They help present the UI; they are not authorization credentials.

For JavaScript actions, use Frontbacked.navigate("/admin/products/detail.html?id=" + id) after a successful save, or Frontbacked.reload() to refresh the current page. These APIs work on storefront and management pages. Relative destinations and { history: "replace" } are supported. Ordinary links, fragment links, GET search forms, and same-site window.open() calls also work. Use links with target="_blank" to preview public pages in a separate tab.

Rejected requests leave the page and its form state intact. Display failed operation responses beside the form; clear values or navigate away only after a successful save. Distinguish access-denied feedback from an empty list. fb-admin also displays an access-denied notice for rejected requests without replacing the embedded page.

Continue with Build admin actions.