Expand description
Breadcrumb engine — walks the page tree once and returns an
ordered list of (title, url, is_current) crumbs.
Powers both public templates (via to_context_value) and
the admin chrome (admin handlers can call resolve_breadcrumbs
directly and stuff the result into Tera context). The shared
_breadcrumbs.html macro in crate::admin::register_templates
renders the standard <nav aria-label="Breadcrumb"> shape plus a
parallel JSON-LD BreadcrumbList block for SEO.
§Public-side example
{# In a Tera template: #}
{% set crumbs = breadcrumbs(page_id=page.id) %}
{% import "_breadcrumbs.html" as bc %}
{{ bc::render(crumbs=crumbs) | safe }}§Options
include_root— keep the tenant root crumb (defaultstrue).include_current— keep the leaf crumb (defaultstrue; public templates usually want this off when the breadcrumb sits right above the page’s<h1>).max_depth— cap the walk to N ancestors; oversized trees degrade gracefully.
Structs§
- Breadcrumbs
Options - Options controlling
resolve_breadcrumbs. - Crumb
- One link in the breadcrumb trail.
Functions§
- resolve_
breadcrumbs - Walk the page’s ancestor chain and return an ordered crumb list from root to leaf.
- to_
context_ value - Convenience: render the breadcrumb crumb list as a JSON value
suitable for stuffing into a Tera context. Use this in admin or
public-render handlers right before calling
tera.render(...):