← Back to Documentation

Field types and the content editor

Every field in <TextField> declares a type. The type decides which editing widget the panel shows you, and, on the front end, which extra variables come along with it.

Text is the simplest: a single-line input, printed as-is. Markdown gives you a full text area backed by CodeMirror, with a small toolbar for headings, a live preview, and an "insert image" button. What gets saved is both the markdown source, so you can edit it again later, and the rendered HTML, so the front end never has to parse markdown on every request. Editor is the same idea but backed by TinyMCE, for anyone who'd rather work in a rich-text box than write markdown by hand.

Image and file fields handle uploads. Pick a file, and the panel moves it into uploads/, checks it's actually an image when the type demands one, and can generate a resized thumbnail automatically if you've set a width or height on the field. Tags stores a comma-separated list and expands it into an array of {name: ...} entries on the front end. That's what makes a row of tag chips, or filtering a flow down to one tag, easy to build. Color, datetime, link, email, html and boolean round out the rest, each with its own validation and its own widget, but the same idea underneath: one JSON field, one type, one widget.

None of these types are hardcoded into your templates. Add a field of any type to a static entry or a flow item from the panel, and the matching {key} variable is just there the next time the page renders.