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

Field Formats

A format says what a value looks like. The form accepts the shapes people type and stores one; a link column on the same field shows it short and linked.

form:
  fields:
    instagram_url:
      label: Instagram
      format: { base: "https://www.instagram.com/", prefix: "@", pattern: "[A-Za-z0-9._]{1,30}", lowercase: true }
list:
  columns:
    instagram_url: { type: link, new_tab: true }
FormField::text("instagram_url", t!("Instagram")).format(
    FieldFormat::new("https://www.instagram.com/").prefix("@").pattern("[A-Za-z0-9._]{1,30}").lowercase(),
)
KeyDefaultDescription
baserequiredThe address every value sits under, ending in /. A path is allowed: https://www.linkedin.com/in/.
prefixnoneShown before the name, and accepted before it when typed.
patternanyA regular expression the whole name must match.
lowercasefalseStores the name lowercased.
name_onlyfalseStores the name alone, acme, in place of the address.

What the form accepts

TypedStored
https://www.instagram.com/acme/?igsh=1https://www.instagram.com/acme
instagram.com/acmehttps://www.instagram.com/acme
@acmehttps://www.instagram.com/acme
acmehttps://www.instagram.com/acme
EmptyEmpty; add required to refuse it
Another site, a path or a name pattern refusesRefused on the field

What the list shows

StoredShown
https://www.instagram.com/acme@acme, linked
A value saved before the formatAs stored

A link column reads its field’s format; format on the column itself overrides it, for a list with no form.

list:
  columns:
    profile: { type: link, format: { base: "https://www.tiktok.com/", prefix: "@" } }