Documentation

Regions and blocks

Region Machine name Notes
Alerts alerts Above the header. Each block is a site-wide alert banner.
Header header Site branding: the seal and the lockup.
Header language header_language Language switcher.
Header search header_search Search form. Below 1024px a search button opens it.
Primary menu primary_menu Main navigation. Below 1024px a menu button opens it.
Highlighted highlighted Status messages.
Breadcrumb breadcrumb
Home spotlight home_spotlight Front page only. See Home page.
Home sections home_sections Front page only. Each block is a band.
Above content above_content Page title, tabs, local actions.
Help help
Content content
In-page navigation page_nav Section navigation, "On this page", "Search on this page". In the sidebar column from 1024px, above the content below that. See In-page navigation.
Sidebar sidebar When used, content narrows to 8 of 12 columns.
Below content below_content Full width.
Footer first footer_first Below the footer logo. Menus here render as social icons.
Footer footer Each block is a column with a heading.
Footer bottom footer_bottom Account menu, Powered by Drupal.

Alerts

Blocks in Alerts render as solid, full-width banners above the header (the maya:site-alert component): an icon, the block title and the block content. Use a content block so editors can change the text; links in it are white and underlined.

Blocks are blue by default. Two classes on the block change that, set with the Block Class module or any module that adds classes to the block's attributes:

  • danger: the red banner, for emergencies.
  • dismissible: adds a dismiss button. A dismissed alert stays hidden for the rest of the browser session (sessionStorage). It shows again once its content block is saved, because the key includes the block ID and the content's changed time. Without JavaScript the button does not show; with storage blocked, a dismissed alert comes back on the next page.

The header is the maya:site-header component. From 1024px up the seal sits to the left of two rows: the lockup, language switcher and search form above a rule, and the main navigation below it. Below 1024px it is one row: seal, lockup, then language, search and menu buttons. Each button opens a panel below the header, and only one opens at a time. Everything works without JavaScript; js/maya.js adds closing on outside click, link click and Escape.

Top-level items with children render as <details> disclosures: dropdown panels from 1024px up and an accordion on smaller screens. Three levels are shown. Arrange the second level into groups:

  • Links that follow one another form a group.
  • A route:<nolink> link with no children is a separator: it draws a rule between the groups before and after it.
  • A link with children starts a group headed by its title, whose links are its children. Use route:<nolink> for a heading that should not link anywhere.

If the top-level item has a link, the panel ends with a button to it, labeled "See all" and the item's title in lowercase, or the item's description when it has one. Use route:<nolink> for top-level items that should not link anywhere.

For SF.gov's Contact panel: Report a problem, Contact City departments and Contact 311 Customer Service Center as links, then Visit us (route:<nolink>) with City Hall and Permit Center as its children, and "Find contacts" as the description of Contact.

Main menu dropdown with groups headed "Resources for" and "Tools"

The same menu as an accordion on a phone

Add a menu with links to your social accounts and place it in Footer first. Core menu blocks and Menu Block blocks both work, so a branch of a larger footer menu can supply the links. Links to Facebook, Instagram, Threads, X, Bluesky, LinkedIn, YouTube, TikTok and Mastodon show that network's icon; other links show their title.

Place menu blocks in Footer with Display title checked. SF.gov uses three: Our City, Policy and Get help. Columns share the row equally and wrap onto a second row when there are more than fit.

In-page navigation

When In-page navigation or Sidebar has content, the page header spans the full width and the content takes 8 of 12 columns below it, as SF.gov's pages do (Components-11 p41–42): the Content region's blocks up to and including the page title block print above the columns, and the rest of the region in the left column. From 1024px In-page navigation heads the right column and Sidebar follows it; with Sidebar empty, the navigation stays in view as the page scrolls. Below 1024px In-page navigation sits above the content, and Sidebar below it.

Blocks to place here:

  • A menu block, rendered as section navigation: a list from 1024px, a dropdown below. See Section navigation.
  • A content block with a btn link such as "Contact us", which takes the full width and sits beside the section dropdown from 768px.
  • Any block with maya:on-this-page, maya:page-search or maya:table-of-contents. For whole content types, In-page navigation settings add the first two without a block.

Region-specific templates

Maya adds a block__region__REGION template suggestion to every block, so block--region--footer.html.twig in a sub-theme restyles every block in the footer.

Teasers

Node teasers render as cards: the title links to the node, and the image, description, date and agency come from the fields the view mode shows. View modes named like teasers (teaser*, or containing card, tile, list, featured, highlight or news) use the same template, unless the sub-theme has a template for that view mode. Views whose rows are cards lay them out in a grid of up to three columns; news cards and tiles stack. People, events and places render as profiles, events and location cards. See Node teasers.

Edit this page