We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28099
    • 39 Posts
    I’m hoping to have FormIt create a selectbox using the menutitle from every child under a particular parent in the resource tree.

    This is not too different than what WayFinder or GetResources normally does. I just haven’t found any examples of this being done.

    Thanks....
      • 3749
      • 24,544 Posts
      There may be an easier way, but you could use a custom snippet in your FormIt form, something like this:

      [[!GetChildren? &parent=`12`]]


      <?php
      /* GetChildren Snippet */
      
      $children = $modx->getCollection('modResource', array ('parent' => $parent));
      
      if (! empty ($children)) {
         $foreach ($children as $child) {
            $menuTitle = $child->get('menutitle);
      
            /* generate appropriate HTML for each child here  */
          }
      }
      
        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