Skip to content

Instantly share code, notes, and snippets.

@ru2fac
Last active November 4, 2018 02:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ru2fac/5a63ae8db87d36721dc7e8e2d5a72dcc to your computer and use it in GitHub Desktop.
Save ru2fac/5a63ae8db87d36721dc7e8e2d5a72dcc to your computer and use it in GitHub Desktop.
<?php
if ($thread = $modx->getObject('TicketThread', array('resource' => $id))) {
echo $thread->get('comments');
}
@ru2fac
Copy link
Author

ru2fac commented Nov 4, 2018

Create snippet called "TicketCommentsCount"

[[!TicketCommentsCount? &id=[[*id]]]]
[[!TicketCommentsCount? &id=``]]
[[!TicketCommentsCount? &id=2]]
[[!TicketCommentsCount:default=`0`? &id=`[[+id]]`]]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment