Skip to content

Instantly share code, notes, and snippets.

@ru2fac
Last active November 4, 2018 02:04
Show Gist options
  • Select an option

  • Save ru2fac/5a63ae8db87d36721dc7e8e2d5a72dcc to your computer and use it in GitHub Desktop.

Select an option

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

ru2fac commented Nov 4, 2018

Copy link
Copy Markdown
Author

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