Skip to content
  1. Extras
  2. Tickets
  3. Snippets
  4. TicketComments

TicketComments

Renders a comment thread and submit form. Works with tickets and any MODX resource.

Call uncached: [[!TicketComments]].

Multiple threads on one page: set different &thread= values. Each wraps in <div class="comments-thread" id="...">.

Parameters

NameDefaultDescription
&threadresource-[[*id]]Comment thread name
&threadUrlAbsolute page URL for comments outside the current document
&tree11 nested replies; 0 flat list with limit/offset pagination
&depth0Max nesting depth (0 = unlimited when tree=1)
&sortbyTicketComment.idSort field
&sortdirASCASC or DESC
&limit0Comment limit; 0 = all
&offset0Query offset
&whereExtra JSON conditions
&fastMode1DB values only, strips unprocessed MODX tags
&outputSeparatornewlineSeparator between comments
&toPlaceholderPlaceholder name instead of direct output
&separatePlaceholder01 puts form in {toPlaceholder}_form, list in {toPlaceholder}_thread
&formBefore0Form before the comment list
&showLog0pdoFetch log for mgr session
&showUnpublished0Show unpublished comments
&allowGuest0Guest comments
&allowGuestEdit1Guests can edit own comments
&allowGuestEmails0Email guests about replies
&requiredFieldsname,emailRequired guest form fields
&autoPublish1Publish logged-in comments without moderation
&autoPublishGuest1Same for guests
&enableCaptcha1Captcha for guests
&minCaptcha1Math captcha minimum
&maxCaptcha10Math captcha maximum
&allowFiles0File uploads on comments
&source0Media source ID; else tickets_source_default
&gravatarIconmmGravatar fallback
&gravatarSize24Avatar size
&gravatarUrlhttps://www.gravatar.com/avatar/Gravatar URL
&tplCommentstpl.Tickets.comment.wrapperThread wrapper; [[+total]] from TicketThread
&tplCommentFormtpl.Tickets.comment.formForm for logged-in users
&tplCommentFormGuesttpl.Tickets.comment.form.guestGuest form
&tplCommentAuthtpl.Tickets.comment.one.authSingle comment (logged in)
&tplCommentGuesttpl.Tickets.comment.one.guestSingle comment (guest)
&tplCommentDeletedtpl.Tickets.comment.one.deletedDeleted comment
&tplLoginToCommenttpl.Tickets.comment.loginLogin required chunk
&tplCommentEmailOwnertpl.Tickets.comment.email.ownerEmail to ticket author
&tplCommentEmailReplytpl.Tickets.comment.email.replyEmail on reply
&tplCommentEmailSubscriptiontpl.Tickets.comment.email.subscriptionEmail to thread subscriber
&tplCommentEmailBcctpl.Tickets.comment.email.bccBCC to admins
&tplCommentEmailUnpublishedtpl.Tickets.comment.email.unpublishedUnpublished comment notice
&tplFilestpl.Tickets.comment.form.filesFile uploader block
&tplFiletpl.Tickets.form.fileFile row
&tplImagetpl.Tickets.form.imageImage row
&validateFormIt rules for field text; see TicketFormit
&customValidatorsFormIt validator snippets

List snippets link comment counts to #first_unread or #comments since 1.14.0.

Examples

Default

fenom
{'!TicketComments' | snippet}
modx
[[!TicketComments]]

Guests with moderation

fenom
{'!TicketComments' | snippet : [
  'allowGuest' => 1,
  'autoPublishGuest' => 0,
]}
modx
[[!TicketComments? &allowGuest=`1` &autoPublishGuest=`0`]]

Flat list

fenom
{'!TicketComments' | snippet : [
  'tree' => 0,
  'limit' => 20,
  'offset' => 0,
]}
modx
[[!TicketComments? &tree=`0` &limit=`20` &offset=`0`]]

Second thread on the page

fenom
{'!TicketComments' | snippet : [
  'thread' => 'sidebar-' ~ $_modx->resource.id,
]}
modx
[[!TicketComments? &thread=`sidebar-[[*id]]`]]