On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • $modx->runSnippet('pdoResources', array(
    	'parents' => (isset($resource) ? $resource : 6),
    	'depth' => (isset($resource) ? 0 : 1),
    	'tpl' => 'item.services_page.entertainments.item',
    	'includeTVs' => 'image,price',
    	'includeContent' => 1,
    	'showUnpublished' => 1,
    	'showHidden' => 0,
    	'where' => '{"template:=":8,"hidemenu:=":0,"deleted:=":0}',
    	'hideContainers' => 1,
    	'limit' => $limit,
    	'maxLimit' => $limit,
        'offset' => ($cur_page - 1) * $limit,
        'totalVar' => 'total_selected'
    ));
    
    return '~'.$modx->getPlaceholder('total_selected').'~';


    Returns me

    ~~

    MODX version is 2.6.1. I don't know is version somehow influencing on this issue, but on other site (which on version 2.5.4) all works. [ed. note: i_am_bars last edited this post 1 year, 5 months ago.]
    • It's critical
      • How about just doing this:

        $fields = array(
            'template' => '8',
            'hidemenu''=> '0',
            'deleted' => '0',
        );
        
        return $modx->getCount('modResource', $fields); 
        
          Did I help you? Buy me a beer
          Get my Book: MODX:The Official Guide
          MODX info for everyone: http://bobsguides.com/modx.html
          My MODX Extras
          Bob's Guides is now hosted at A2 MODX Hosting
        • Solved. New parameter was introduces, but not documented. It's need to write &setTotal=`1` ('setTotal' => 1)
          • Quote from: BobRay at Mar 08, 2018, 09:09 PM
            How about just doing this:

            $fields = array(
                'template' => '8',
                'hidemenu''=> '0',
                'deleted' => '0',
            );
            
            return $modx->getCount('modResource', $fields); 
            

            No, thanks. It's requires one more query to database.