ContentBlocks ContentBlocks 2.x Input Types
Built-in input types for ContentBlocks 2. Each type is referenced by "type" in block JSON inputs, drawer, or modal configuration.
Inputs are the most basic building blocks of ContentBlocks. They define the type of data that can be stored in a block, and can be combined to create a wide variety of structured content.
Remember that inputs are content, and that you can add behavior via plugins on block, layout, or canvas level.
Table of Contents
Catalog
| Type | Use for |
|---|---|
| Text | Single-line text |
| Textarea | Multi-line plain text |
| Richtext | Full MODX rich text editor |
| Number | Numeric values with min/max/step |
| Select | Dropdown (static, chunk, or snippet options) |
| Toggle | On/off checkbox |
| Color | Color picker with palette |
| Image | MODX media browser image |
| Icon | Font Awesome icon picker |
| Link | Resource, URL, email, or tel links |
| Video | YouTube, Vimeo, Wistia, Loom, or direct embed |
| Chunk | Select and configure a MODX chunk |
| Snippet | Select and configure a MODX snippet |
| Code | Ace code editor |
| Repeater | Repeatable rows of nested inputs |
| Tabs | Fixed editor tabs grouping inputs |
| List | Nested ordered/unordered lists |
| Label | Static manager label (no stored data) |
| Spacer | Blank spacing in the manager (no stored data) |
| Heading | Visual heading with level |
| Horizontal Rule | Divider line (no stored data) |
Rich text options
For lightweight formatting on text fields, see Rich Text Options. ContentBlocks 2 supports a full rich text editor (like Redactor or TinyMCE), but also ships with MiniRTE that can add basic formatting (like bold, italic, and underline) and links to regular text or textarea inputs.
Custom input types
To build your own input type, see Creating Custom Inputs. Input Patterns shows the approaches used by the core inputs: extra stored keys, modals, the media browser, shared libraries, and options loaded from a connector.