I see a way to do what I want by creating a multidimensional array and looping through it, but I don't know how to loop through an infinite amount of "sub-arrays". The navigation could go as deep as 5 or 6 levels. Here is an example of an array that could work:
$nav = array
(
array
(
// About Us
'caption' => 'About Us',
'link' => '/aboutus/'
),
array
(
// Projects & Programs
'caption' => 'Projects & Programs',
'link' => '/projects/',
'children' => array
(
array
(
// Direct Evangelism
'caption' => 'Direct Evangelism',
'link' => '/projects/direct_evanglelism.php'
),
array
(
// Music
'caption' => 'Music',
'link' => '/projects/music.php'
),
)
),
array
(
// Tool & Resources
'caption' => 'Tools & Resources',
'link' => '/tools/'
)
);
If all of the navigation was printed it would look like this:
About Us
Pojects & Programs
Direct Evangelism
Music
Tools & Resources
The problem is that I don't know how to dig into this array when one of the array values is "children" (which means there are subpages to that page). I was think of calling a function to loop through this array like this (the variable is the path to the current file. The function would be given a different path for every page):
writeHTML('Projects & Programs/Music');
I hope this helps. Thanks.