We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4172
    • 5,888 Posts
    not sure, if you need to create a query-object:

    private function getArtworkCount($gallery_id) {
        $c = $this->modx->newQuery('artworks');
        $c->where(array('gallery_id' => $gallery_id));
        $count = $this->modx->getCount('artworks',$c);
        $this->modx->log(modX::LOG_LEVEL_DEBUG, 'The current value of count:' . $count); // count is zero if this criteria is specified
        return $count;
    }
      -------------------------------

      you can buy me a beer, if you like MIGX

      http://webcmsolutions.de/migx.html

      Thanks!
      • 44195
      • 293 Posts
      Yes Bruno! That did work. I see what I was doing wrongly: I wasn't thinking at row level.
      Thanks once again smiley

      It seems that I didn't need the new query, it works without.
        I'm lead developer at Digital Penguin Creative Studio in Hong Kong. https://www.digitalpenguin.hk
        Check out the MODX tutorial series on my blog at https://www.hkwebdeveloper.com