Skip to content

Page header and breadcrumb

view_builder.generate() renders a common header above the widgets of a page, and the topbar shows where the page sits:

Page header and breadcrumb

from fastpluggy.core.widgets import AutoLinkWidget, ButtonWidget

return view_builder.generate(
    request,
    top_title="Reports",               # section: breadcrumb and the line above the title
    title="Nightly report",            # page title: header, breadcrumb, <title>
    subtitle="3 runs in the last 24 h",
    actions=[                          # buttons on the right of the title
        ButtonWidget(url="/reports/export", label="Export", icon="ti ti-download"),
        AutoLinkWidget(route_name="run_report", label="Run now", css_class="btn btn-primary",
                       confirm="Run the report now? It takes a few minutes."),
    ],
    widgets=[...],
)
Argument Shown as
title the page title (<h1>), the last breadcrumb segment, and the document title "title · application"
top_title the breadcrumb segment between the application and the page, and the line above the title
top_title_url makes that breadcrumb segment a link (a plugin's page links back to Plugins)
parent_crumbs breadcrumb segments before top_title, as [{"label": ..., "url": ...}] (url optional); a plugin's page shows "application › Admin › Plugins › plugin"
subtitle a line under the title
actions buttons on the right of the title; each is processed like a table link (condition=False hides it, confirm= asks first). A DropdownButtonWidget groups the rarer ones in a menu

All of them are optional. A page that passes only title gets the title and the breadcrumb "application › title"; a page without title gets no header. Values are escaped like every other value the core prints (see Template escaping).

The header comes with generic_page.html.j2, the template generate() uses. A plugin template that extends base.html.j2 itself gets the breadcrumb only, and keeps its own heading.

The Admin entry and the admin home

For admins (or when no authentication is installed) the sidebar ends with one entry, Admin. It carries the number of active critical and warning advisories, loaded after the page renders, and it is the active entry on every admin page:

  • the core's admin pages;
  • a plugin's routes declared with @menu_entry(..., type='admin') (the Plugin tools below);
  • any page whose breadcrumb goes through the admin home, i.e. built with **admin_crumb(request, ...) (fastpluggy.core.menu.system): a plugin's admin page with no menu entry of its own, such as an edit form, gets it this way.

A plugin's other pages (main or user menu) leave it inactive. The URL is not used: plugin routes are mounted outside the admin's prefix.

It opens the admin home, which holds:

  • Health: the core's version, the plugins, the authentication, the events, debug mode;
  • Needs attention: the most serious advisories, and All advisories for the full list;
  • System: the core's admin pages, Plugins, Settings, Events, Capabilities and Menu;
  • Plugin tools: the plugins' entries declared with type='admin' (@menu_entry(..., type='admin'), or module_menu_type = "admin"), with their sub-menus.

The core's admin pages show Admin as their section in the breadcrumb, linking back to it; a plugin's page shows "Admin › Plugins › plugin", both levels linked. Every one of these pages is also found by the search palette (Ctrl K).