maori-roll-booth-finder

layout:maori-roll-booth-finder

This Basic content layout creates a homepage banner linking visitors to the Māori Roll Booth Finder. It displays a red location marker, promotional copy and a button on a black background, with an image alongside the text on desktop and above it on mobile.

#Setup

  1. Create or edit a Basic subpage beneath Home, which uses the subpage layout system.
  2. Apply the tag layout:maori-roll-booth-finder to that Basic subpage.
  3. Attach the banner image to this Basic subpage.
  4. Publish the subpage and check Include in support nav. Position it using the homepage's Sub nav pages tab.
  5. On the separate finder destination page, add the page tag maori-roll-booth-finder and ensure it is published. The banner button uses that page's URL.

Button destination

The two tags have different jobs:

Tag Where to apply it What it does
layout:maori-roll-booth-finder The homepage banner's Basic subpage Selects this banner layout.
maori-roll-booth-finder The published finder destination page Supplies the button's destination URL.

Keep the plain maori-roll-booth-finder tag on one published destination page only. To point the button at another page, remove the tag from the old destination and add it to the new published destination. Do not add this plain tag to the banner subpage.

The button follows the tagged page's current URL, so changing that destination does not require a hardcoded link or theme edit. If no published page has the destination tag, the button is not displayed. If several published pages have it, the theme uses the first match from its most-recent published pages collection; keeping a single match avoids an unintended destination.

After changing the tag or the destination page's slug, preview Home and test the Tīmata. Let's go button.

Data mappings

Page field Displayed as
First image attachment Banner image. Attach it to the banner's Basic subpage.

The attachment image is the only content field read from the banner's Basic subpage. The button destination is managed separately through the tagged destination page described above.

Fixed content

The introductory line, Māori Roll Booth Finder heading, supporting text, red location marker and Tīmata. Let's go button label are fixed in the template. Contact a For Purpose developer to change the copy, button label or styling. Editors can change the button destination using the page tag above.

Images

The layout uses the first attachment whose file type is an image. There is no social share image fallback. Without an image attachment, the banner displays the text and button across the available width.

Images are cropped to fill the panel: approximately 6:5 on desktop and 3:2 on mobile, aligned to the bottom centre. Keep important details away from the edges and check both screen sizes after changing the image.

The homepage banner's image is managed on its own Basic subpage. The images used inside the Māori Roll Booth Finder are attachments to the separate finder page.

Developer reference

The layout files are in the Māori Party project under themes/tpm2023-fp-64eeb7f9c18c0209fd2e49a5/:

The maori-roll-booth-finder case in _z_module_basic.html loads this layout when the Basic page has the layout:maori-roll-booth-finder tag. The button lookup normalises the destination tag to maori_roll_booth_finder and uses tag.most_recent_published_pages_no_pagination with limit:1.