We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19777
    • 35 Posts
    Here’s a tiny snippet I wrote that some may find useful. I called it [[GetChildID]].
    It returns the ID of a child folder with a specific name. I use this in the Ditto &startID variable, you can use it how you wish.

    The call is:
    [[GetChildID?&childsName=`SubfolderName`]]



    The snippet code is:
    <?php
    $docid = (isset($docid)) ? $docid: $modx->documentIdentifier;
    
    $children= $modx->getActiveChildren($docid, 'id', 'ASC');
    foreach($children as $value){
     if($value['pagetitle']==$childsName){
        $childsID= $value['id'];
        return $childsID;    
        break;
     }
    }
    ?>
      • 6726
      • 7,075 Posts
      This one will sit nicely along GetField and GetParent, thanks grin !
        .: COO - Commerce Guys - Community Driven Innovation :.


        MODx est l&#39;outil id