Site Index Generator Source Code
This page is generated by the software reading the menu.xml file and displaying the main heading items and descriptions from the file, showing each directory and links for all the sub items.
Part of siteIndex.php showing the php code:
<?php
// Load the xml menu file into simpleXML
$xml = simplexml_load_file("menu.xml");
// Loop through file
foreach($xml->menuItem as $item)
{
// Send links and descriptions to the screen
echo "<h2>" . $item->title->a . "</h2>";
echo "<p>" . $item->description . "</p>";
// Use child nodes
$subXml = $item;
// Start bullets
echo "<ul>";
// Loop through child
foreach($subXml->menuItem as $subItem)
{
// Send to screen
echo "<li><a href=\"" . $subItem->title->a->attributes() . "\">"
. $subItem->title->a . "</a></li>";
}
// End bullets
echo "</ul>";
}
?>


