All chunks fall into three groups:
- Default — use the
xcomm3x-*CSS classes of the built-in theme - Bootstrap 5 — Bootstrap 5 examples, without
xcomm3x-*classes - UIKit 3 — UIKit 3 examples, without
xcomm3x-*classes
The examples can be copied and adapted to any CSS framework — all JS hooks work through data-xc-* attributes, not classes.
Default chunks
xcomm3x_comment_item
Template of one comment in the thread.
Placeholders:
| Placeholder | Description |
|---|---|
[[+id]] | Comment ID |
[[+depth]] | Nesting depth (0 = root) |
[[+author_name]] | Author name |
[[+date]] | Creation date |
[[+body]] | HTML content (the text or “[deleted]”) |
[[+vote_widget]] | Voting widget (+/− buttons) |
[[+reply_btn]] | “Reply” button (empty string if not available) |
[[+edit_btn]] | “Edit” button (empty string if not available) |
[[+delete_btn]] | “Delete” button (empty string if not available) |
[[+resource_id]] | Resource ID |
[[+block_key]] | Block key |
[[+token]] | Deletion token |
Required data-* attributes (needed by JS):
data-xc-comment="[[+id]]"— on the root element of the commentid="comment-[[+id]]"— on the root element, links in emails point to itdata-depth="[[+depth]]"— on the root elementdata-xc-edit-area="[[+id]]"— container for the edit formdata-xc-reply-area="[[+id]]"— container for the reply form
xcomm3x_thread_outer
Wrapper of the whole comment thread.
Placeholders:
| Placeholder | Description |
|---|---|
[[+items]] | HTML of all comments |
[[+resource_id]] | Resource ID |
[[+block_key]] | Block key |
Required data-* attributes:
data-xc-thread— on the wrapperdata-resource-id="[[+resource_id]]"— on the wrapperdata-block-key="[[+block_key]]"— on the wrapper
xcomm3x_post_form
New comment form.
Placeholders:
| Placeholder | Description |
|---|---|
[[+resource_id]] | Resource ID |
[[+block_key]] | Block key |
[[+guest_fields]] | HTML of the name/email fields (guests only) |
[[+captcha_html]] | HTML of the CAPTCHA block |
Required data-* attributes:
data-xc-form— on the<form>tagdata-resource-id="[[+resource_id]]"— on<form>data-block-key="[[+block_key]]"— on<form>data-xc-result— on the container for the success/error messagedata-resource-idanddata-block-key— also ondata-xc-result
Required hidden fields:
<input type="hidden" name="action" value="Web/PostComment">
<input type="hidden" name="resource_id" value="[[+resource_id]]">
<input type="hidden" name="block_key" value="[[+block_key]]">
Honeypot field (spam protection):
<input type="text" name="website" style="position:absolute;left:-9999px" tabindex="-1" autocomplete="off">
xcomm3x_guest_fields
Name and email fields for guests. Output inside [[+guest_fields]] in the form.
Required field names: author_name, author_email.
xcomm3x_reply_form
Reply form. Loaded via AJAX when “Reply” is clicked.
Placeholders:
| Placeholder | Description |
|---|---|
[[+parent_id]] | Parent comment ID |
[[+resource_id]] | Resource ID |
[[+block_key]] | Block key |
[[+guest_fields]] | Guest fields |
[[+captcha_html]] | CAPTCHA (usually off for replies) |
Required data-* attributes:
data-xc-reply-form="[[+parent_id]]"— on the<form>tagdata-xc-reply-result="[[+parent_id]]"— on the result container
Required hidden fields:
<input type="hidden" name="action" value="Web/PostComment">
<input type="hidden" name="resource_id" value="[[+resource_id]]">
<input type="hidden" name="block_key" value="[[+block_key]]">
<input type="hidden" name="parent_id" value="[[+parent_id]]">
The “Cancel” button must have data-xc-cancel="[[+parent_id]]".
xcomm3x_edit_form
Comment edit form. Loaded via AJAX when “Edit” is clicked.
Placeholders:
| Placeholder | Description |
|---|---|
[[+id]] | ID of the edited comment |
Required data-* attributes:
data-xc-edit-form="[[+id]]"— on the<form>tag
Required hidden fields:
<input type="hidden" name="action" value="Web/UpdateOwnComment">
<input type="hidden" name="id" value="[[+id]]">
The “Cancel” button must have data-xc-edit-cancel="[[+id]]".
xcomm3x_reply_btn
The “Reply” button. Output inside [[+reply_btn]] in the comment chunk.
Placeholders: [[+id]], [[+resource_id]], [[+block_key]].
Required data-* attributes:
data-xc-reply="[[+id]]"data-resource-id="[[+resource_id]]"data-block-key="[[+block_key]]"
xcomm3x_edit_btn
The “Edit” button. Output inside [[+edit_btn]].
Placeholders: [[+id]].
Required data-* attribute: data-xc-edit="[[+id]]".
xcomm3x_delete_btn
The “Delete” button. Output inside [[+delete_btn]].
Placeholders: [[+id]], [[+token]].
Required data-* attributes:
data-xc-delete="1"data-id="[[+id]]"data-token="[[+token]]"
xcomm3x_load_more
The “Load more” button. Output after the comment list if there is a next page.
Placeholders: [[+cursor]], [[+cursor_date]], [[+load_more_tpl]], [[+limit]].
Required data-* attributes:
data-xc-load-more-wrap— on the button containerdata-xc-load-more="1"— on the button itselfdata-cursor="[[+cursor]]"— on the buttondata-cursor-date="[[+cursor_date]]"— on the buttondata-load-more-tpl="[[+load_more_tpl]]"— on the button; the signed name of this chunk, without it the next pages show the default buttondata-limit="[[+limit]]"— on the button; the size of the next portion, without itxcomm3x.comments_per_pageis used
xcomm3x_no_comments
Message shown when there are no comments. Any HTML. The data-xc-no-comments attribute on the root element lets the message be removed after the first comment.
Bootstrap 5 examples
| Chunk | Replaces |
|---|---|
xcomm3x_bs5_comment_item | xcomm3x_comment_item |
xcomm3x_bs5_thread_outer | xcomm3x_thread_outer |
xcomm3x_bs5_post_form | xcomm3x_post_form |
xcomm3x_bs5_guest_fields | xcomm3x_guest_fields |
xcomm3x_bs5_reply_form | xcomm3x_reply_form |
xcomm3x_bs5_edit_form | xcomm3x_edit_form |
xcomm3x_bs5_reply_btn | xcomm3x_reply_btn |
xcomm3x_bs5_edit_btn | xcomm3x_edit_btn |
xcomm3x_bs5_delete_btn | xcomm3x_delete_btn |
xcomm3x_bs5_load_more | xcomm3x_load_more |
xcomm3x_bs5_no_comments | xcomm3x_no_comments |
UIKit 3 examples
| Chunk | Replaces |
|---|---|
xcomm3x_uk3_comment_item | xcomm3x_comment_item |
xcomm3x_uk3_thread_outer | xcomm3x_thread_outer |
xcomm3x_uk3_post_form | xcomm3x_post_form |
xcomm3x_uk3_guest_fields | xcomm3x_guest_fields |
xcomm3x_uk3_reply_form | xcomm3x_reply_form |
xcomm3x_uk3_edit_form | xcomm3x_edit_form |
xcomm3x_uk3_reply_btn | xcomm3x_reply_btn |
xcomm3x_uk3_edit_btn | xcomm3x_edit_btn |
xcomm3x_uk3_delete_btn | xcomm3x_delete_btn |
xcomm3x_uk3_load_more | xcomm3x_load_more |
xcomm3x_uk3_no_comments | xcomm3x_no_comments |
Notes
Functional classes in [[+body]] and [[+vote_widget]]
These classes are generated by PHP and are present in all themes — JS needs them and they cannot be removed:
| Class | Where | Purpose |
|---|---|---|
xcomm3x-text | inside [[+body]] | JS reads the text via .xcomm3x-text when opening the edit form |
xcomm3x-deleted | inside [[+body]] | Marker of a deleted comment |
xcomm3x-vote-widget | inside [[+vote_widget]] | JS updates the widget via .xcomm3x-vote-widget after voting |
Creating your own theme
Copy any set of example chunks (BS5 or UIKit3), rename them your way, replace the CSS classes with your own and pass the new names in the snippet parameters. The JS logic works exclusively through data-xc-* attributes.