Accent Fields Images

Single

One image — a media reference, boundary-held to pictures.


One image: a media reference constrained to pictures — the Images kind's scalar shape. In the admin this is the Image field type.

What is stored

The asset's id. The file lives in the library once; fields point at it, so replacing the file updates every use.

Declaring one

Label Hero image
Key hero_image
Data type media
Editor image_picker
Constraint images only — enforced by the picker AND the write boundary

The contract

The picker only offers images, but the picker is not the contract — the write boundary refuses a non-image id (wrong_media_kind) so the API and agent lanes are held to the same promise. A template reading this field never meets a pdf.

An example

At render the reference wakes to a resolved object — {src, alt, width, height, sizes…} — so the template never holds the raw id:

<% if (hero_image) { %>
  <img src="<%= hero_image.src %>" alt="<%= hero_image.alt %>"
       width="<%= hero_image.width %>" height="<%= hero_image.height %>">
<% } %>

The guard matters: a deleted library asset wakes to nothing, and the boundary deliberately does not block saves over history — render nothing rather than a broken image. sizes carries the named variants when the library has generated them — the responsive story lives on the asset, not the field.

When the other shape fits

Several images where the set and order are content — a gallery — is the Multiple shape.