Hey I am trying to get the count for blog posts within a collection however I want to be more specific.
I want to be able to count the children but only ones that tag (template variable) match a certain one.
I have this code that will return the count of the whole collection:
<?php
$count = 0;
$parent = isset($parent) ? (integer) $parent : 0;
if ($parent > 0) {
$criteria = array(
'parent' => $parent,
'deleted' => false,
'published' => true,
);
$count = $modx->getCount('modResource', $criteria);
}
return (string) $count;
But i would like to add to the $criteria array something like " 'tv.filterTag' => 'blogTag1' "
Is this possible?
Thank you in advance
Ryan