We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3749
    • 24,544 Posts
    I think what you actually want may be:

    $modx->getChildIds($id) and modx->getParentIds($id).

    The getChildIds() method returns an array containing any children of the specified resource. Similarly, the getParentIds() method returns an array containing the IDs of all ancestors up the tree. If there are none, you’ll get back an empty array. If you need to know how many there are, you can use count() on the return value.

    BTW, there is a hasChildren() method, but it is a method of the resource object, not the $modx object. To see if the current resource has children:

    if ($modx->resource->hasChildren()) {
      /* yes there are children */
    } else {
       /* no children */
    
    }
      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
      • 25979
      • 178 Posts
      yeap, that is what I want. Thanks a lot smiley

      Regards,

      MIke
        //Why use windows since there is a door?//