From 4fe985945d3f1565cda46782a38ab36a858d243d Mon Sep 17 00:00:00 2001 From: nightcityblade Date: Wed, 16 Sep 2026 03:45:01 +0800 Subject: [PATCH] Document customizing breadcrumbs (#2885) Refs #1902 --- docs/custom_templates.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/custom_templates.rst b/docs/custom_templates.rst index 50c23b3e..edb70670 100644 --- a/docs/custom_templates.rst +++ b/docs/custom_templates.rst @@ -302,6 +302,14 @@ content you can do so by creating a ``row.html`` template like this: Note the ``default:row.html`` template name, which ensures Jinja will inherit from the default template. +The default ``base.html`` template provides a ``crumbs`` block inside its navigation block. Override ``crumbs`` to customize the breadcrumbs without replacing the rest of the navigation. The imported ``crumbs.nav()`` macro renders Datasette's permission-aware breadcrumbs: + +.. code-block:: jinja + + {% block crumbs %} + {{ crumbs.nav(request=request, database=database, table=table) }} + {% endblock %} + The ``_table.html`` template is included by both the row and the table pages, and a list of rows. The default ``_table.html`` template renders them as an HTML template and `can be seen here `_.