We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7858
    • 97 Posts
    Hi, I need to load all the children of some resource plus several resources with given IDs, and i'm stuck with it...

    How can i add specified IDs here

    $getWsItems = $modx->newQuery('modResource',array(
        'parent' => $resParent,
        'published' => 1,
    ));

    ?

    thx
      • 22303 MODX Staff
      • 10,725 Posts
      Quote from: dopeless at Jul 19, 2012, 03:07 PM
      How can i add specified IDs here

      $getWsItems = $modx->newQuery('modResource',array(
          'parent' => $resParent,
          'published' => 1,
      ));


      $getWsItems = $modx->newQuery('modResource', array(
          array('parent' => $resParent, 'OR:id:IN' => array(1,2,3,4,5)),
          'published' => 1,
      ));

      i.e.
      WHERE ( parent = $resParent OR id IN (1,2,3,4,5) ) AND published = 1
        • 7858
        • 97 Posts
        Thank you so much )