getPublishedDB(); foreach ($pagesKeys as $pageKey) { // Build the page $page = buildPage($pageKey); // If the page is not a child this means the page is main page or parent page if (!$page->isChild()) { echo '
'.$page->title().'
'; // Get all children of the page $childrenKeys = $page->children(); // Check if the page has children if ($childrenKeys!==false) { echo '
    '; // Foreach child foreach ($childrenKeys as $childKey) { // Build the child $pageChild = buildPage($childKey); echo '
  • '; echo ''.$pageChild->title().''; echo '
  • '; } echo '
'; } } } ?>