<![CDATA[ [Solved] Doesn't setting placeholder totalVar of pdoResources - My Forums]]> https://forums.modx.com/thread/?thread=103581 <![CDATA[ [Solved] Doesn't setting placeholder totalVar of pdoResources]]> https://forums.modx.com/thread/103581/doesn-t-setting-placeholder-totalvar-of-pdoresources#dis-post-557241
$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.]]>
i_am_bars Mar 07, 2018, 02:55 PM https://forums.modx.com/thread/103581/doesn-t-setting-placeholder-totalvar-of-pdoresources#dis-post-557241
<![CDATA[Re: [Solved] Doesn't setting placeholder totalVar of pdoResources]]> https://forums.modx.com/thread/103581/doesn-t-setting-placeholder-totalvar-of-pdoresources#dis-post-557310 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.]]>
i_am_bars Mar 11, 2018, 03:10 AM https://forums.modx.com/thread/103581/doesn-t-setting-placeholder-totalvar-of-pdoresources#dis-post-557310
<![CDATA[Re: Doesn't setting placeholder totalVar of pdoResources]]> https://forums.modx.com/thread/103581/doesn-t-setting-placeholder-totalvar-of-pdoresources#dis-post-557309 i_am_bars Mar 11, 2018, 03:08 AM https://forums.modx.com/thread/103581/doesn-t-setting-placeholder-totalvar-of-pdoresources#dis-post-557309 <![CDATA[Re: Doesn't setting placeholder totalVar of pdoResources]]> https://forums.modx.com/thread/103581/doesn-t-setting-placeholder-totalvar-of-pdoresources#dis-post-557286
$fields = array(
    'template' => '8',
    'hidemenu''=> '0',
    'deleted' => '0',
);

return $modx->getCount('modResource', $fields); 
]]>
BobRay Mar 08, 2018, 09:09 PM https://forums.modx.com/thread/103581/doesn-t-setting-placeholder-totalvar-of-pdoresources#dis-post-557286
<![CDATA[Re: Doesn't setting placeholder totalVar of pdoResources]]> https://forums.modx.com/thread/103581/doesn-t-setting-placeholder-totalvar-of-pdoresources#dis-post-557273 i_am_bars Mar 08, 2018, 02:59 PM https://forums.modx.com/thread/103581/doesn-t-setting-placeholder-totalvar-of-pdoresources#dis-post-557273