# Site Menu module

Modern Laravel 11 replacement for the former `plugins/SiteMenu` plugin (now
removed). Renders
customisable, nestable site navigation as fully server-rendered, crawlable HTML
(no client-side framework), with progressive-enhancement JavaScript for
dropdown / mega-menu interactivity.

## Why this exists

The legacy plugin server-rendered only the top-level links and rendered the
entire sub-tree client-side via a Vue component. With no SSR, non-JS crawlers
never saw the sub-navigation, weakening internal linking and SEO. This module
renders the complete nested tree server-side.

## Structure

- `Models/SiteMenuItem.php` — Eloquent model (self-referencing tree, dynamic
  category/brand/CMS enrichment, caching). Reuses the existing `site_menu` table.
- `Services/SiteMenuRenderer.php` — resolves the correct menu, builds the tree
  and renders the Twig template. Target of the `load_site_menu` hook.
- `Http/Controllers/Admin/SiteMenuController.php` — admin CRUD / reorder.
- `routes/site_menu.php` — admin routes (`web`, `auth`, prefix `admin`).
- `config/site_menu.php` — first container class, cache TTL.
- `database/migrations/` — idempotent table create for fresh installs.

## Usage

Rendered via the existing hook, unchanged for template authors:

```twig
{{ hooks_do_action('load_site_menu', 'Main Navigation Menu') }}
```

The presentational Twig partial and BEM styles live in the site theme
(`sites/default/templates/SiteMenu/` and the `siteMenu` LESS block).
