I'm having some problems with a site that I am working on. I've been working on building a content management system that will allow me to sort the links in my navigation pannel and also open up a sub pannel in the menu
For example, let's say I've got several items in my nav table:
sort name
1 Home
2 Link 1
3 Link 2
4 Link 3
5 Link 4
Let's then say that the user wants to open up link3 and view the submenu. I would like my navigation pannel to respond as follows without using my SQL and using a global navigation page:
sort name
1 Home
2 Link 3
<li>Sub1</li>
<li>Sub2</li>
3 Link 1
4 Link 2
5 Link 4
msnbc.com functions like this and I am particularly fond of it. Can anybody think of how to do this? Here's what I've got so far
<?php $thisPage="Home"; ?>
<html>
<head>
<title>Selling</title>
/CSS Management*/
</head>
<?php if ($thisPage=="Link3") {
echo " class=\"open\"";
} else " class=\"closed\""; ?>>
<div id="navigation>
<ul>
<li>Home</li>
<li>Link 3</li>
<div id="sublink">
<ul>
<li>Sublink1</li>
<li>Sublink2</li>
</ul>
</div>
</ul>
</div>
<?php if ($thisPage=="Link2") {
echo " class=\"open\"";
} else " class=\"closed\""; ?>>
<div id="navigation>
<ul>
<li>Home</li>
<li>Link2</li>
<div id="sublink">
<ul>
<li>Sublink1</li>
<li>Sublink2</li>
</ul>
</div>
</ul>
</div>
I just can't seem to figure out how to assign the variables to do this efficiently. Any help would be appreciated.
-Mike