Accent Fields Options

Select

The dropdown — pick one, store the value.


The dropdown: pick one of the declared options. Stores the chosen option's value as a string — never the label — and shares that contract with Radio: swap the two and no template changes.

Declaring one

Label Status
Key status
Data type string
Editor select
Options on_sale → "On sale" · sold_out → "Sold out" · past → "Past"

In the admin this is the Select field type.

An example

<% if (cms.asset.content.status === 'sold_out') { %>
  <span class="badge">Sold out</span>
<% } %>
{ "content": { "status": "sold_out" } }

The contract

The write boundary refuses anything off the list — one_of, derived from the options themselves. A template never meets "Sold Out", "soldout", or a typo. Emptiness stays required's question.

When another method fits better

  • Five or fewer options that deserve to be seenradio shows the whole set at the cost of the space it takes.
  • More than one answer can be truecheckboxes or multi-select; the test is whether two answers could ever both hold at once.