[[pdoResources?
&parents=`0`
&select=`{
"modResource":"id, pagetitle",
"Children":"COUNT(Children.id) as count"
}`
&leftJoin=`{
"Children":{"class":"modResource", "on":"modResource.id = Children.parent"}
}`
&sortby=`{"id":"ASC"}`
&where=`{"parent":0, "Children.id:IS NOT":null}`
&groupby=`modResource.id`
&limit=`0`
&tpl=`@INLINE <p>{$id}. {$pagetitle} - {$count} {$count | decl : "дочерний ресурс|дочерних ресурса|дочерних ресурсов"}</p>`
&showLog=`0`
]]Как вывести только контейнеры MODX
05 июля 2016, 13:58
Будут выведены только те ресурсы, у которых есть дочерние.
Объектная
[[pdoResources? &parents=`0` &select=`{ "modResource":"id, pagetitle", "Children":"COUNT(Children.id) as count" }` &leftJoin=`{ "Children":{ "class":"modResource", "on":"modResource.id = Children.parent" } }` &sortby=`{ "id":"ASC" }` &where=`{ "parent":0, "Children.id:IS NOT":null }` &groupby=`modResource.id` &limit=`0` &tpl=`@INLINE <p>[[+id]]. [[+pagetitle]] - [[+count]] {$count | decl : "дочерний ресурс|дочерних ресурса|дочерних ресурсов"}</p>` &showLog=`0` ]]