The marketing CMS where agents draft and people publish
Menu

Page frame: utility bar, header buttons, mega menu, footer and breadcrumbs

Status: built (Unreleased). Owner: core. This is the spec the first batch of "general" gaps asked for: the header and footer that large institutional sites share, built from the menus and settings Spillway already has, rendered on the server and cached like the rest of the page.

Why

Large institutional sites put the same frame around every page: a slim bar of utility links above the header (portals, directory, give) with an "Info for" list of audiences, two or three action buttons in the header (Apply, Visit, Give), a main menu whose top items open wide panels with columns, a footer with columns of links, the organization's address and social profiles, and a trail of breadcrumbs above the content. Spillway's shell had the logo, the tagline, a menu toggle, the header search, account links, a one-level drop-down menu and a one-row footer. Everything below is optional: a site that fills nothing in looks exactly as before.

Data

No new tables. Everything is in the menu items (JSON in menu.items) and the site settings (JSON in site.content).

  • Menu items gain three optional fields, meaningful on top-level items:
    • button: 'primary' | 'secondary': on the main menu, the item shows as a button in the header instead of a link in the menu.
    • promo: '<shared block key>': the item's panel shows that shared block beside its columns.
    • popularSearches: true: the item's panel lists the site's popular searches (the first query of each search pin, Site settings → Search, at most six), each a link to the search page.
  • Menus nest three levels (MENU_MAX_DEPTH 3, was 2). On the main menu, a top item whose children have children of their own opens a mega panel: each such child is a column heading (a link when it has one) over its children. A top item with only plain children keeps today's simple drop-down.
  • Menu keys with a place in the frame: main (header), footer (footer), and two optional ones a site creates when it wants them: utility (the bar above the header) and audience (the "Info for" list in that bar; the menu's label is the button's text).
  • Site settings → Organization (SiteSettings.organization): address (street, locality, region, postal code, country), phone, email, social (a list of { network, url }, network from a fixed list). They show in the footer and feed the home page's Organization structured data (address, telephone, email, sameAs), which before carried only the name, URL and logo.
  • Site settings → Breadcrumbs (SiteSettings.breadcrumbs): types (content type keys whose pages show breadcrumbs above the content) and source (path, the default, or menu).

Rendering

All in render/shell.tsx, from shellMenus (menus/index.ts), on the server.

  • Utility bar: a <nav aria-label="Utility"> above the header with the utility links on one side and, when the audience menu has items, an "Info for" disclosure on the other. From 900 px only; below that the same links (and the audience list) sit at the bottom of the mobile menu.
  • Header buttons: the main menu's top items with button render as sw-button--primary or --secondary links after the search and account links on desktop, and at the top of the mobile menu on phones. They are left out of the menu list.
  • Drop-downs and mega panels: server markup is a <details> per parent item (so without script the panel opens and every link is reachable, as today). A small script (FRAME_SCRIPT) upgrades each one to the disclosure pattern: a <button aria-expanded aria-controls> and a panel that is hidden until the button is pressed. Escape closes the open panel and returns focus to its button; opening one closes the others; a click outside, or focus leaving the item on a wide screen, closes it. Nothing opens on hover. Transitions are off under prefers-reduced-motion: reduce and the visitor's Reduce motion switch.
  • Mega panel: up to four columns, the column headings as <h2>-less list headings (a heading element would pollute the page outline; they are <p class="sw-mega__heading"> with the group labelled by aria-labelledby), the top item's own link first as "Overview", the promo (the shared block rendered like a placed block, its styles in the page) and the popular searches. On phones the columns stack inside the mobile menu.
  • Footer: when the footer menu has items with children, each such item is a column (its heading, then its links); top items without children stay in the bottom row as today. When the organization has an address, phone, email or social profiles, or the footer has columns, a brand column leads: the Brand logo (the site name without one), the address in an <address>, the phone and email as links, the social profiles as a list of named links. The bottom row keeps its order: the flat footer links, Cookie settings, Reduce motion, the copyright; then the footer note. A site with a flat footer and no organization fields renders the same markup as before.
  • Breadcrumbs: a new Breadcrumbs block (packages/blocks) renders <nav aria-label="Breadcrumb"><ol> with aria-current="page" on the last item. Its resolver builds the trail with the code the BreadcrumbList structured data uses (marketing/breadcrumbs.ts, shared by both): from the path (each ancestor path's published page title, else the humanized segment) or, with source: 'menu', from the page's position in the main menu (falling back to the path when the page is not in it). It can be placed with Structure → Placements like a shared block or a menu, or shown on every page of the types listed under Site settings → Breadcrumbs, which adds it above the content (before the placed blocks of that region) unless a placement already shows breadcrumbs there or the page hides the region.

Caching

Every page already carries site:<id> (settings, organization, breadcrumbs, search pins) and theme where it shows the brand; a brand publish purges theme and site:<id>. The shell adds menu:utility and menu:audience beside menu:main and menu:footer, and a promo adds shared:<key> and its own block tags. Breadcrumbs from the menu add menu:main. All evictions go through the page cache, so the CDN hook purges them too.

API and tools

  • PUT /api/menus/:id and POST /api/menus accept the item fields; GET /api/public/render returns menus.utility, menus.audience and the item fields; GET /api/public/site (and site in the render answer) carries organization.
  • PUT /api/site accepts organization and breadcrumbs.
  • Placements accept { type: 'Breadcrumbs', props: { source, showCurrent } }.
  • MCP: create_menu and update_menu take button, promo and popularSearches; update_site_settings takes organization and breadcrumbs; create_placement takes the Breadcrumbs block.

Admin

  • Menus: on a top-level item, More gains "Show as button" (primary, secondary, off), and on the main menu a "Panel" row with the promo (a shared block picker) and "Popular searches". A second-level item with sub-items shows a "Column heading" badge. The menus list says where utility and audience show, and offers to create them when they do not exist.
  • Site settings → Site gains an Organization section (address, phone, email, social profiles) and a Breadcrumbs section (the content types, the source).
  • Structure → Placements gains Breadcrumbs as a third kind of block.

Kits

The higher-ed kit gets a utility menu, an audience menu, Apply, Visit and Give as header buttons, a columned footer and a breadcrumbs placement on its content types. The other kits gain a utility menu where it clearly helps (city: pay, report, contact; nonprofit: Donate as a button). Kit menus accept the same item fields and three levels.

Out of scope

Hover-to-open, a sticky header, per-audience landing logic and icons for social networks (the links are named text, which is accessible and works with any brand); a site can add icons through its theme.

Spillway 0.1.24

Was this page helpful?