Contents
- Domma CMS User Manual
- 1. Using the CMS
- 2. Tutorials
- 3. Components
- 4. API Reference
- 5. Tools
CTA Shortcode
Updated by Darryl Waterhouse on 29 September 2026 · 1 min read
The [cta] shortcode places an action-trigger button in any public page. Clicking it calls POST /api/actions/:slug/public with the entry ID, using the logged-in user's JWT. If the user is not logged in, a warning toast is shown instead. The action decides who may run it (its roles and row-level rule, checked on the server), and Actions need a MongoDB connection - see Actions.
Syntax & Attributes
Wrapping form:
[cta action="slug" entry="entry-id" icon="check" confirm="Are you sure?"]Button label[/cta]
Self-closing form:
[cta action="slug" entry="entry-id" label="Button label" /]
| Attribute | Required | Default | Description |
|---|---|---|---|
action | Yes | - | Action slug |
entry | Yes | - | Entry UUID to act on |
label | No | "Run" | Button text (self-closing only) |
style | No | "primary" | primary · secondary · ghost · danger |
icon | No | - | Domma icon name |
size | No | - | sm · md · lg |
confirm | No | - | Confirmation prompt before executing |
Collection Integration
Add per-entry buttons to any [collection] shortcode:
[collection slug="applications" display="cards" title-field="name"
cta="approve-application"
cta-label="Approve"
cta-icon="check"
cta-style="primary"
cta-confirm="Approve this application?" /]
| Attribute | Default | Description |
|---|---|---|
cta | - | Action slug - enables per-entry buttons |
cta-label | "Run" | Button label |
cta-icon | - | Domma icon name |
cta-style | "primary" | Button variant |
cta-confirm | - | Confirmation prompt |
CTA buttons appear on the cards (card footer), list (inline), table (a column of its own) and block displays, and on each row of an interactive Collection Browser. On a scope="mine" block the server refuses a row the visitor did not create.
A saved View takes the same buttons with action="slug" and the same cta-label, cta-style, cta-icon and cta-confirm attributes:
[view slug="pending-applications" display="cards" action="approve-application" cta-label="Approve" /]
For buttons that change with each row's state (Submit, Withdraw, Approve), use transitions on an interactive [collection] instead - see Actions.
On this page