# Agents

## Agents

**Files:** `src/content/agents/<language>/`, portraits in `src/assets/images/lotline/agents/` · **Skill level:** Beginner

Each agent is one file: name, role, portrait, contact details, the neighborhoods they cover, and a bio. From that one file Lotline builds their profile page, their card on `/agents/`, the contact card on every home they list, the agents row on the neighborhoods they cover, and the author line on their blog posts.

<div class="border border-dark">
  ![A Lotline agent profile with the portrait, role, bio and contact rows](/images/lotline/agent.jpg)
</div>

### An Agent File
```yaml
# src/content/agents/english/daniel-hart.md
---
title: "Daniel Hart" # the agent's name
role: "Founder and principal broker"
bio: "Started the agency in 2004 and still handles most of the Elm Hill sales himself."
image: "/images/lotline/agents/agent-1.jpg" # 4:5 portrait
email: "daniel@example.com"
phone: "+15550100101" # E.164, for tel: links
phoneDisplay: "(555) 010-0101"
since: 2004 # year joined
languages:
  - "English"
areas: # file names in src/content/neighborhoods/; empty = every neighborhood
  - "elm-hill"
  - "cedar-park"
stats:
  - label: "Homes sold"
    value: "310"
  - label: "Years with us"
    value: "22"
weight: 1 # lowest first
draft: false
---

Daniel opened the agency in 2004 with one desk in the city center...
```

| Field | Type | What it does |
| --- | --- | --- |
| `title` (required) | text | The agent's name |
| `role` | text | Under the name on the card and the profile: `"Sales director"` |
| `bio` | text | One or two lines about the agent. The profile's meta description when `description` is empty |
| `image` | image path | A 4:5 portrait for the card, the profile and the contact cards |
| `email` | text | The email row on the profile and the contact card |
| `phone`, `phoneDisplay` | text | `phone` in E.164 format (`+` and the country code, digits only) for the call link, `phoneDisplay` as people read it |
| `languages` | list of text | The languages row on the profile, and `knowsLanguage` in structured data |
| `areas` | list of neighborhood ids | The neighborhoods they cover. Empty means every neighborhood |
| `stats` | list of `label`, `value` | Up to three figure cards on the profile. The values count up as they scroll into view |
| `since` | whole number | The year they joined. Kept with the agent, not shown on the page |
| `weight` | number | Order everywhere (lowest first) |
| Named blocks | | `pageHeader` and `ctaSection` for this profile only |

The text under the frontmatter is the full bio on the profile.

<Aside type="caution" title="A strict schema">
  The agents collection is strict: `npm run astro-check` reports any key it
  doesn't know, such as a misspelled `phoneDisplay`. That catches typos early.
  Use only the fields in the table above, plus the fields every page accepts.
</Aside>

Every agent shows their own email and phone. If your agency takes every call at the front desk, put the office email and number in each agent file instead.

### Where Agents Appear
| Place | What it shows | Picks agents by |
| --- | --- | --- |
| `/agents/` | Every agent as a portrait card with the name and role, three to a row, then the pine tile | `weight` |
| `/agents/<file name>/` | The profile: portrait, name, role, bio, contact rows, the neighborhoods, the stat cards, then every home that names them as `agent` | |
| Property pages | The "Listing agent" card beside the area card | The listing's `agent` |
| Development pages | The sales contact card beside the sign-up form | The development's `agent` |
| Neighborhood pages | The agents row, up to four | Agents whose `areas` include the neighborhood, then agents with empty `areas` |
| Developments home, about | The agents section, four portrait cards | `ids`, or every agent by `weight` |
| Blog posts | The author line, with portrait and profile link | The post's `author` matching the file name |

The agents section takes `ids` (file names in the order you want) and `limit` (default 4, `0` for every agent):

```yaml
# src/content/about-us/english/-index.md
agentsSection:
  enable: true
  title: "The people you'll work with"
  ids: ["daniel-hart", "omar-reyes", "lucas-bennett", "marcus-lin"] # optional: pick by hand
  limit: 4
```

### The Agents Page
<div class="border border-dark">
  ![The Lotline agents page with portrait cards](/images/lotline/agents.jpg)
</div>

`src/content/agents/english/-index.md` holds the title, the page header, the call to action, and `endCard`, the pine tile after the last agent:

```yaml
endCard: # pine tile after the last agent; enable: false hides it
  enable: true
  title: "Want to know what your home is worth?"
  text: "One of us will come over, walk through it with you and send a written price within two business days. It's free."
  button:
    enable: true
    label: "Book a valuation"
    url: "/valuation/"
```

Every profile page uses the band photo and the call to action of this file, unless the agent's own file sets `pageHeader` or `ctaSection`.

### Add An Agent
<Steps>

1. Copy an agent file, for example `src/content/agents/english/ethan-cole.md`, and rename it after the person: `first-last.md`. The file name is the profile URL and the id other files use.
2. Put their portrait (4:5, at least 760 by 950 pixels) in `src/assets/images/lotline/agents/` and point `image` at it.
3. Fill in the fields. In `areas`, use file names from `src/content/neighborhoods/`.
4. Copy the file into `french/` and `arabic/` with the same name. Translate `role`, `bio` and the body. Keep the name, email and phone the same.
5. Run `npm run astro-check`.

</Steps>

To remove an agent, first move their listings and developments to someone else (change `agent:` in those files), then delete the agent file in every language. A listing that names an agent who no longer exists shows no agent card. Blog posts keep their `author` text, without the photo and link.

The sample agents, their phone numbers and their stats are made up. Use real photos of your own people, with their consent.

### Do It With AI
```text
Add an agent to my Lotline site: [NAME], [ROLE], email [EMAIL], phone [PHONE], languages
[LIST], covering the neighborhoods [LIST]. Bio: [TEXT]. Portrait: [FILE NAME] in
src/assets/images/lotline/agents/. Copy src/content/agents/english/ethan-cole.md to a new file
named after the agent (first-last.md), use only keys the agents schema in src/content.config.ts
allows (it is strict), write phone in E.164 format, and use file names from
src/content/neighborhoods/ in areas. Create the French and Arabic files with the same name,
then run npm run astro-check.
```