Skip to content

The field wrapper

The single most important pattern to match. Every setting in the CP lives in a .field shell: a heading with an optional required dot, instructions, the input, and any tip / warning / errors below. The *Field macros build all of this for you.

How this entry is referenced in URLs.

Leave blank to generate from the title.
{{ forms.textField({
    label: "Slug"|t("app"),
    instructions: "How this entry is referenced in URLs."|t("app"),
    tip: "Leave blank to generate from the title."|t("app"),
    id: "slug",
    name: "slug",
    value: entry.slug ?? "",
    required: true,
    errors: entry.getErrors("slug"),
}) }}
Config key Effect
label Bold heading above the input
instructions Subtle help text (Markdown supported)
required Adds the red required dot to the label
tip / warning Blue tip or amber warning line below the input
errors Array of validation messages, rendered in red
id / name / value Standard input wiring