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

getComments

Comment list from the database via pdoFetch. For feeds, widgets, and thread filters.

Call uncached.

Parameters

NameDefaultDescription
&tpltpl.Tickets.comment.list.rowSingle comment chunk
&tplCommentDeletedtpl.Tickets.comment.one.deletedDeleted comment
&threadsThread IDs, comma-separated; -id excludes
&commentsComment IDs, comma-separated; -id excludes
&parentsParent section/ticket IDs to pick threads
&resourcesTicket IDs to pick threads
&depth10Depth when filtering by parents
&limit10Limit (pdoFetch)
&offset0Offset
&userAuthor user IDs or usernames
&sortbycreatedonSort field
&sortdirDESCSort direction
&includeContent0Ticket and section content fields
&fastMode1DB values only
&showUnpublished0Unpublished comments
&showDeleted0Deleted comments
&whereExtra JSON conditions
&outputSeparatornewlineRow separator
&toPlaceholderPlaceholder instead of output
&tplWrapperWrapper with output placeholder
&showLog0Log for mgr

Подсказка

The list can be extended with the common parameters of pdoTools, since Tickets is built on that library.

Examples

Feed with pagination

fenom
{'!pdoPage' | snippet : [
  'element' => 'getComments',
  'parents' => 5,
  'limit' => 10,
]}
{$_modx->getPlaceholder('page.nav')}
modx
[[!pdoPage?
  &element=`getComments`
  &parents=`5`
  &limit=`10`
]]

[[!+page.nav]]

Latest comments in a section

fenom
{'!getComments' | snippet : [
  'parents' => 5,
  'limit' => 5,
  'sortby' => 'createdon',
  'sortdir' => 'DESC',
]}
modx
[[!getComments?
  &parents=`5`
  &limit=`5`
  &sortby=`createdon`
  &sortdir=`DESC`
]]