Field type
code
Monospace textarea for code snippets. Same stored shape as textarea (plain string) but rendered with a fixed-width font for readability.
Type: code · Stored attribute type: string
Stored value
string
Supports
- Plain string values, no syntax highlighting
- Configurable height via
rows
Config options
| Option | Type | Default | Description |
|---|---|---|---|
rows | number | 8 | Height of the textarea, in rows. |
placeholder | string | Greyed-out hint shown when the input is empty. | |
helpText | string | One-line description shown below the input. |
Gotchas
- No syntax highlighting or auto-indent — a future version may swap in CodeMirror, but for now it's a styled textarea.
- Server-side: never echo the value as HTML without escaping. For executable snippets you control, render inside
<pre><code>afteresc_html().
Example
{ "id": "ctrl_embed",
"type": "code",
"label": "Embed snippet",
"attributeKey": "embed",
"rows": 6,
"parentPanelId": "panel" }Every field also takes the keys common to all fields.