Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Navigation

A resource and a screen each add their own menu entry. A module adds sections and extra entries through its registry.

Add an entry

# descriptors/posts.yaml
menu: { under: acme.content, icon: file-text, order: 2 }
registry.add_nav(NavItem::new("acme.reports", "Reports", "/reports").permission("acme.reports"));

Resource::new("/posts", "Posts", list)
    .permission("acme.posts")
    .menu(Placement::new().under("acme.content").icon("file-text").order(2))

ScreenReg::new("/reports", "acme.reports", Arc::new(ReportsScreen))
    .in_menu("Reports")
    .menu(Placement::new().under("acme.content"))
menu keyDefaultDescription
underthe top barThe key of the section the entry sits under.
iconnoneAn icon name from the icon set.
slotapplicationThe band the entry belongs to (see below).
order0Sorts among siblings of the band, lowest first; equal orders sort by label.
after, beforenoneSits right after or before the sibling with that key, whatever the bands say. A resource’s key is resource: and its path (resource:/posts), a screen’s screen: and its path, a contributed item’s its own.
in_settingsnoneA Settings category heading (System): the entry is listed in Settings under it, with no menu entry.
descriptionnoneThe line under the label in Settings.
menu: falseMounts the routes with no menu entry.
SlotValueHolds
home0The dashboard.
content100What the site publishes.
media200The media library.
application500The application’s own screens: the default.
people700Accounts and roles.
tools800Reports, logs and tools.
system900Settings.
lasti32::MAXAfter everything.
NavItemDescription
NavItem::new(key, label, path)An entry leading to path under the admin mount.
NavItem::section(key, label)A tab holding entries; it leads to the first one the operator may open.
.icon(name), .order(n), .after(key), .before(key), .under(key), .permission(code)As the menu keys above; permission hides the entry from an operator without it.
.in_settings(category)Renders the entry in Settings under category (see below).
.description(text)The line under the label in Settings.

A resource’s entry carries the resource’s permission, a screen’s its own. A duplicate key, under naming a key nobody declared, or after and before naming no sibling, aborts the start.

Add a section

registry.add_nav(NavItem::section("acme.content", "Content").icon("folder").order(10));

Resource::new("/pages", "Pages", list)
    .menu(Placement::new().under("acme.content").order(1))

A section is a tab in the top bar. An operator sees only the entries they may open; a section with none left is not shown. Dashboard and Settings are always first and last.

Place a section in Settings

registry.add_nav(
    NavItem::section("acme.shop", t!("Shop"))
        .icon("store")
        .description(t!("Products, orders and invoices."))
        .slot(slot::SYSTEM)
        .in_settings(t!("Shop")),
);
# descriptors/products.yaml
menu: { under: acme.shop, order: 1 }
# descriptors/orders.yaml
menu: { under: acme.shop, order: 2 }
PlacedRenders
A sectionOne settings item linking to its first entry; each entry’s list shows the entries as tabs.
An entryA settings item linking to its page.
A tab the operator lacks the permission forLeft out of the tabs.

A deployment’s [backend.menu] move places a section the same way, or puts a module’s settings section back in the top bar with its entries in the sidebar:

[backend.menu]
"acme.shop" = { in = "backend.settings", category = "Shop" }
"rainmill.pdf" = { in = "backend.nav" }

Order a hierarchy

[backend.order]
"backend.nav" = ["dashboard", "acme.shop", "media", "settings"]
"backend.nav.acme.content" = ["resource:/pages", "resource:/posts"]
"backend.settings" = ["backend.branding", "web.themes"]
HierarchyKeysPinned
backend.navThe top bar’s entries.dashboard first, settings last.
backend.nav.<section>A section’s entries.none
backend.settingsSettings items by code.none

A key left out keeps its arrangement after the listed ones; a key that is no entry is skipped.

A hierarchy of your own takes the same [backend.order] key:

use laterite_core::arrange::{arrange, Arranged, Hierarchy, Overrides, Policy, Position, slot};

let widgets = arrange(
    &Hierarchy::new("acme.dashboard").policy(Policy::Fixed),
    widgets,
    Overrides { deployment: config.order.get("acme.dashboard").map(Vec::as_slice), operator: None },
)?;
Hierarchy builderDescription
new(key)The key [backend.order] names.
policy(Policy::Fixed)Renders the declared arrangement; overrides are logged and ignored. Adjustable is the default.
operator_adjustable()Lets an operator’s preference rearrange it too.
pin_first(key), pin_last(key)Keys that hold the ends whatever anyone says.

Move an entry

[backend.menu]
"backend.access_log" = { in = "backend.nav", slot = "tools" }
"resource:/orders" = { in = "backend.settings", category = "Shop", order = 5 }
"screen:/reports" = { in = "backend.nav.acme.content" }
[backend.menu] keyMeaning
The entryA menu key (resource:/orders, screen:/reports, a contributed item’s key) or a settings item’s code.
inbackend.nav, backend.nav.<section> or backend.settings.
slot, orderThe band and order there; the entry’s own when left out.
categoryThe settings heading; the band’s name when left out.

A moved entry keeps its label, icon, permission and target: a resource moved into settings opens at its own path with the settings sidebar beside it, and a settings item moved into the top bar is a tab. A section moved into settings is one item with its entries as tabs.

Register a palette source

# descriptors/posts.yaml
palette: acme.posttitles
Resource::new("/posts", "Posts", list).palette("acme.posttitles")
KeyDescription
paletteA registered picker source. The command palette (Ctrl+K, Cmd+K) finds this resource’s records through it and opens each at its edit page. Absent keeps the records out.