-
- 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....
-
- 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 */
}
}