Settings
Adding your own section
This page - "Example: your own section" in the nav above -
is a real, working route added the same way a consuming
app adds its own project-specific section (Billing,
Integrations, whatever the project actually needs),
without touching components/_settings_nav.html.twig
at all:
-
Add an entry to your own copy of the sections array -
Foundry's own version is
App\Showcase\Settings\SettingsSectionProvider::sections(), but a consuming app with real accounts computesvisiblefromis_granted()instead of a demo role. - Give it a route, a controller action, and a template extending the same shell every other settings page uses.
-
Call
components/_settings_nav.html.twig'snav()macro from your new template exactly as every other settings page here does - it doesn't know or care that a new section exists beyond the array it's handed.
Nothing in the reusable macro or the shared nav-collapse rule needed to change to add this page.