We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 11316
    • 81 Posts
    API:getDocumentChildren

    API:getDocumentChildrenTVars

    API:getDocumentChildrenTVarOutput

    I have been trying to use print_r but it just shows me blank Array (). I have setup tv’s in the container also - like image or text.

    Does anyone have some simple examples to help me get strated. The API documentation is great and tried to plug that into a snippet but I cant get anything.

    something simple as:

    1. <?php
    2. echo ( ’<pre>’ );
    3. print_r($modx->documentObject); //tried getDocumentChildrenTVars but nothing pops out of the container documents.
    4. echo ( ’</pre>’ );
    5. die;
    6. ?>
      • 4310
      • 2,310 Posts
      <?php
      $test = $modx->getDocumentChildren('15');
      echo '<pre>';
      print_r($test);
      echo '</pre>';
      ?>
        • 11316
        • 81 Posts
        thanks bunk58 that worked - duh! identify the parent (newbie over site) any simple examples for:

        API:getDocumentChildrenTVars

        API:getDocumentChildrenTVarOutput

        Still get nothing - maybe I don’t understand what is supposed do to or what it supposed to show. I was hoping to get an array of childdocument tv variables and what they output. eg text - image.

        Thank you again.