> ## Documentation Index
> Fetch the complete documentation index at: https://realsite.ca/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Layouts & templates

> What renders where, and which variables each template receives.

Every request renders one **template** inside a **layout**. The layout owns
the `<head>`, header, and footer; templates provide `{{ content_for_layout }}`.

## Variables available everywhere

| Variable | What it is |
| - | - |
| `site` | The [site object](/docs/developers/objects#site) — agent, contact, nav, posts, areas |
| `settings` | Theme settings: schema defaults merged with the owner's choices |
| `current_path` | The request path — useful for active-nav states and forms |
| `page_title` | Set per template; fall back to `site.name` |

## Per-template variables

| Template | Receives |
| - | - |
| `index` | `listings` (featured/active), `sold_listings`, `stats`, `map_listings`, `cover` when used, everything global |
| `listing` | `listing` — one [listing object](/docs/developers/objects#listing) |
| `search` | `results`, `total`, `all_count`, `query`, `page`, `has_prev`, `has_next`, `prev_url`, `next_url`, `data_updated` |
| `page` / `page.landing` | `page` (`title`, `slug`), the page's zone |
| `blog` | `posts` — array of [post hashes](/docs/developers/objects#posts) |
| `post` | `post` — one post hash (plus `published_at_iso`) |
| `area` | `area` (`name`, `city`, `blurb`), `area_listings` |
| `404` | globals only |

## Homepage composition

The stock themes use an owner-arrangeable `home-main` zone. For example:

```liquid theme={null}
{% zone 'home-main', default: 'agent-masthead, agent-approach, featured-listings, home-valuation, agent-invitation' %}
```

That list is a fresh-zone default, not an instruction to overwrite an
existing arrangement. Keep `home-main` when redesigning a site so its saved
section settings and blocks remain addressable. Style the homepage through
its own classes; avoid broad selectors that unintentionally alter listing
search or listing detail.

Each stock theme opens with its own `listing-hero` (Cover) section, which
reads the `cover` object: a featured listing, the agent's chosen photograph
or a stock scene. When `cover.kind` is `headshot` the section renders the
theme's portrait opening instead. Its `featured-listings` section skips
`cover.listing` so a home is never shown twice.

## Contact controls belong to the layout

Agent openings and Personal contact invitation use buttons with
`data-contact-open`. The layout supplies the `dialog[data-contact-modal]`
and a `data-contact-close` control. Its form posts to `/lead` with
`kind=contact`, `data-lead-form="contact-modal"` and `sf=contact-modal` so
the runtime can reopen the correct form after a success or error redirect.
Keep the honeypot and `{% marketing_consent %}` fields; the starter's
`snippets/contact-dialog.liquid` is a complete example.

REALsite injects `storefront.js` after Liquid renders. Keep that platform
runtime responsible for contact dialogs, form states and partial refreshes.
Landing layouts need the same dialog if their sections use contact buttons.

On search pages, use the supplied `prev_url` and `next_url` for pagination;
constructing a URL from only `page` drops the visitor's selected filters.

## Landing pages are a layout decision

Templates named `page.landing*` render inside `layout/landing.liquid` when
the theme provides one — brand line, content, micro-footer, and
deliberately no navigation. Any page becomes a landing page by taking a
`landing` template; the de-chroming happens at the layout level, so the
sections inside stay ordinary sections.

Published landing pages allow search indexing by default. The page’s **Search
settings** control this independently of its layout. REALsite sends an
`X-Robots-Tag: noindex` response header when indexing is disabled, including
for custom themes. Do not hard-code a `noindex` meta tag in your landing
layout: it would exclude the page even when the agent allows indexing.
Use `canonical_url` for the canonical link; it resolves to the root URL for
a page on its own domain.

## Alternate page templates

Add `templates/page.<suffix>.liquid` and owners see it in the Pages
template picker. A deleted template degrades gracefully back to `page` —
never to an error.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.