Frontend
The JS file (xcomm3x.js) reads its configuration from window.Xcomm3xConfigs, generated by the Xcomm3x and XcommThread snippets. The config holds the connector URL and the names of all chunks for AJAX rendering.
All interactive elements are marked with data-xc-* attributes — JS works only through them, not through CSS classes. This lets you use any CSS framework without changing the logic.
Main data-xc-* attributes:
| Attribute | Where | Purpose |
|---|---|---|
data-xc-thread | thread wrapper | mount point; holds data-resource-id and data-block-key |
data-xc-form | comment form | submission is tracked |
data-xc-comment="ID" | comment element | identification for AJAX updates |
data-xc-reply="ID" | “Reply” button | opens the reply form |
data-xc-edit="ID" | “Edit” button | opens the edit form |
data-xc-delete="1" | “Delete” button | starts deletion |
data-xc-load-more="1" | pagination button | loads the next portion |
Backend
All frontend requests go to the public connector assets/components/xcomm3x/connector.php. The connector checks the CSRF token (session-based, passed in window.Xcomm3xConfigs) and routes requests to processors.
The manager page uses a separate connector, assets/components/xcomm3x/htmx-connector.php — it is available only to logged-in MODX managers and only for HTMX/AJAX requests.
Database tables
| Table | Purpose |
|---|---|
xcomm3x_comment | comments: text, author, status, rating, depth, path (for the tree) |
xcomm3x_comment_vote | comment votes (one vote per visitor) |
xcomm3x_publication_vote | page votes |
xcomm3x_mail_queue | email notification queue: status, attempts, send time |
xcomm3x_mail_unsubscribe | unsubscriptions by email and channel |
xcomm3x_stopword | stop words with the reaction mode |
xcomm3x_blocked_ip | blocked IPs and CIDR masks |
Comment lifecycle
- Posting — Fetch POST to
connector.php?action=Web/PostComment - Validation — CSRF, rate limit, IP blocks, stop words, CAPTCHA, honeypot
- Saving — status
pending(with moderation) orapproved(without) - Notifications — records in
xcomm3x_mail_queuefor all subscribed channels - Rendering — if approved right away, the server returns the HTML of the new comment via the
commentTplchunk; JS inserts it into the thread without reloading the page