# Menus and widgets

## Managed menus

**Appearance → Menus** builds navigation from records, not from template edits.

Each menu item has:

| Field | Purpose |
|---|---|
| Label | Display text, translatable |
| URL | Internal path or external URL |
| Audience | Everyone, guests only, or signed-in members only |
| Locales | Comma-separated list; empty means every language |
| New tab | Whether the link opens in a new tab |
| Order | Drag to reorder |

Internal links are stored base-path agnostic and rendered through the URL helper, so a menu built on a root install keeps working after a move to `/community`.

The `menu.items` filter lets a plugin add or remove visible items. See [Hooks reference](../05-extensions/HOOKS-REFERENCE.md).

## Widget regions

Nine regions are available to widgets:

`header_top`, `nav_extra`, `homepage_main`, `home_sidebar`, `question_sidebar`, `footer_col_1`, `footer_col_2`, `footer_col_3`, `footer_bottom`

`homepage_main` renders inside the home feed area; `home_sidebar` and `question_sidebar` render in the respective sidebars.

## Widgets

**Appearance → Widgets** places structured widget types into regions and orders them by dragging. Widgets are structured records, not arbitrary HTML — the type decides what data it renders and the server decides how.

Typical types include category lists, popular tags, unanswered questions, latest discussions, community statistics, guidelines text, and ad slots.

Each widget can be enabled or disabled without deleting it, and its title is translatable per language through widget translations.

The `widgets.register` filter lets a plugin add a widget type.

## Layouts

A layout groups region assignments. The default layout ships pre-populated so a fresh install is not blank. Deleting the active layout is refused.

## RTL and LTR

Regions and widgets use logical CSS properties. A widget built for English renders correctly in Arabic without a mirrored stylesheet.

## Ordering and failure isolation

Widget rendering is wrapped: a widget that fails logs the failure and renders nothing. One broken widget never takes the page down.

## Mobile bottom navigation

**Appearance → Branding → Mobile navigation** adds a fixed bar at the bottom of the screen with Home, Discussions, Ask and Notifications (or Sign in for a guest).

- **Off by default.** A theme built around its own header should not gain a second navigation bar from an upgrade.
- **Touch screens only.** It appears under `pointer: coarse` at the phone tier. On a mouse-driven narrow window the header is already within reach and a fixed bar would only cost vertical space.
- It lives in the shared layout, so all themes inherit it; a theme that overrides `layouts/app` opts out of it.
- The page reserves the space the bar covers, and the scroll-to-top button is lifted clear of it.

## Collapsible header search

Below the phone tier the header search collapses behind a toggle and opens as a full-width panel. It previously occupied an entire row of the header on every phone.

The toggle exposes `aria-expanded`, moves focus into the field on open, and closes on Escape. Above that tier the toggle is removed from the page entirely and the field is always visible.
