I'm trying to make a function that will display preview thumbnails for collections. The problem is, the data set I'm working with has a collection tree, and some collections don't have items--only their child collections do. So I'm trying to get my function to look for items in the collection, and if it can't find any, look for items in child collections. I have most of the function, but I need a way to look for child collections. So far I have:
<br />
function pinstripe_get_first_collection_images() {<br />
if (total_items_in_collection() == 0) {<br />
echo "Whoa! Nothing here!";<br />
/* find child items */<br />
$childID=/*call function to get id of child collection here*/<br />
set_current_collection(get_collection_by_id($childID));<br />
while(loop_items_in_collection(4)) echo item_square_thumbnail();<br />
} else {<br />
while(loop_items_in_collection(4)) echo item_square_thumbnail();<br />
return $html;<br />
}<br />
}<br />
Any ideas about what function(s) I can use to get child collections?