Section navigation
The pages of a section are written once, as its navigation, and drawn as the app chooses: tabs under the header, as on the other pages of this section, or the side menu standing for the section while one is in it — as on this page, whose menu on the left is this section's.
Writing it
A section's layout sets page_section_navigation: what the section is (label, href), where it is left for (back), and its views (items), each a route the reader may open — the others are left out. An item stays lit on a family of pages (match), and may hold views of its own (children).
{%- set page_section_navigation = {
label: organization.name,
href: path('organization_show', { id: organization.id }),
back: { href: path('organization_index'), label: 'Organizations' },
items: [
{ label: 'Overview', icon: 'ph:bold/gauge', route: 'organization_show', params: { id: organization.id } },
{ label: 'Accounting', icon: 'ph:bold/calculator', route: 'accounting_show', params: { id: ledger.id }, children: [
{ label: 'Bank', icon: 'ph:bold/bank', route: 'accounting_bank_index', params: { ledger: ledger.id }, match: 'accounting_bank_' },
] },
],
} -%}
Drawing it
layout_section_navigation says how: tabs by default, which show the level the page stands in — a view's children under the way back to the section — or menu, which shows the section whole, the way back on top and the view holding the page unfolded.
{# The app's layout: every section takes the side menu while one is in it. #}
{%- set layout_section_navigation = 'menu' -%}