We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 16532
    • 38 Posts
    hi all

    i try to show children documents on homepage but all these children documents are not homepage ’s children.

    i used getDocumentChildren function but it’s not work. i’m not sure how to use this function.

    help me

    thanks
      • 36592
      • 970 Posts
      I don’t know what you want to achieve, but it seems that using Ditto or getField snippet is much easier...
        • 13332
        • 18 Posts
        Hi!

        You must give to the function getDocumentChildren "id" of your parentpage.

        For example, you want to get information about children, where the parentpage id=5:

        <?php
        $Children=$modx->getDocumentChildren(5);
        //------------ 
        echo "<pre>";
        print_r($Children);
        echo "</pre>";
        ?>


        P.S. Sorry, for my English. It is my first message in english topic.
          ModX