Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

List Columns

Every built-in column type. The keys every column takes (label, width, labels, …) are on List Descriptor, and a type of your own is Writing a Column Type.

text

columns:
  title: { searchable: true }

The value as stored, or its entry under labels. The type when none is written; the search box looks in it.

datetime

columns:
  created_at: { type: datetime, align: right }

A date and time in the display timezone.

date

columns:
  published_on: { type: date }

A date in the display timezone.

time

columns:
  opens_at: { type: time }

A time of day in the display timezone.

boolean

columns:
  is_live: { type: boolean, width: 80px }
ValueShown as
1, trueYes
0, false, emptyNo

status_pill

columns:
  status: { type: status_pill, labels: [{ value: draft, label: Draft }, { value: live, label: Live }] }

A pill coloured by the value, lowercased with anything but letters and digits made a hyphen, and reading as its entry under labels.

columns:
  website:   { type: link, new_tab: true }
  instagram: { type: link, icon: instagram, text: "@{value|handle}", new_tab: true }
  order:     { type: link, url: "acme/orders/{id}/edit", text: "Open {code}" }
KeyDefaultDescription
urlthe valueThe address, with {value} for the cell’s value, {id} for the record’s and {column} for another column on the list. A value filled in is URL-encoded. An address with no scheme and no leading / is under the admin.
textthe valueWhat the link reads, with the same placeholders. "" shows the icon alone.
PlaceholderFills in
{value}, {id}, {column}The value as stored
{value|handle}The last part of a link’s path, without @: band from https://social.acme/@band
{value|host}A link’s domain, without www.: acme.com
iconnone
new_tabfalse
formatthe field’s
CaseShown as
http, https, mailto, tel or a / pathA link
Any other address (javascript:, data:)Text
A placeholder whose column is not on the list, or is emptyText
An empty value with no urlNothing

partial

A cell drawn by a template a module registers.

registry.add(PartialReg::new(
    "acme.stock_level",
    include_str!("../partials/stock_level.html"),
));
columns:
  stock: { type: partial, path: acme.stock_level }
{# partials/stock_level.html #}
{% if value | int < 5 %}<b style="color:var(--danger)">{{ value }} left</b>
{% else %}{{ value }} in stock{% endif %}
<small>{{ record.sku }}</small>
KeyDefaultDescription
pathThe partial’s registered name. Required; a name nobody registered stops the boot.
VariableHolds
valueThe cell’s stored value, as text.
recordEvery column on the list by name, as text, and id. A column hidden from the list is not in it.
columnThe column’s keys from the list file.

The template is MiniJinja. A value written with {{ }} is escaped as HTML; the template’s own markup is not. The column sorts, searches and exports by its stored value. A template that fails shows the value as text.