-
- 2 Posts
I am trying to get the published children of a specific document. Sounds pretty simple, but I just can't get the syntax correct. This is what I have:
$criteria = $modx->newQuery('modResource');
$criteria->where(array(
'parent=1',
'published' => true,
));
$criteria->sortby('menuindex','ASC');
$columns = $modx->resource->getMany('Children',$criteria);
Anytime I add the "published" option to $criteria, it crashes. Please help!
-
- 5,888 Posts
try this:
<?php
$criteria = $modx->newQuery('modResource');
$criteria->where(array(
'parent' => 1,
'published' => 1
));
$criteria->sortby('menuindex','ASC');
$columns = $modx->resource->getMany('Children',$criteria);