BACKGROUND
Okay, let me see if I can make any sense... I've built a website for a customer who wants to be able to add and delete pages as needed, as well as update the content on any page at anytime... Seems kind of simple, but it had to be all web based, and "stupified" for the not so smart people in their organization. Here is where the challenge comes in. All of this content needs to be stored in a database.
WHAT WE DID
So we created a table of pages and each pages is essentially linked to another... IE pageid 1 = HOME pageid 2 = Whatever and is a subpage of 1. Makes sense, and the navigation works great... But when we try to do something like build a list of pages, it turns into a complete nightmare. For instance, I want to Add a new page, and I need to make it a subpage of <dropdown list of pages>
IE the dropdown would be something like this:
<select name="whatever">
<option value=1>HOME</option>
<option value=2>HOME -> WHATEVER</option>
<option value=3>HOME -> WHATEVER -> WHATEVER2</option>
<option value=4>ABOUT US</option>
<option value=5>CONTACT US</option>
</select>
MY THOUGHTS
Although I've been able to make this work, and successfully only query my database 2 times for all the pages, I still feel like it could be better... The challenges that I face are that the page levels are essentially infinite. We have no idea of how many pages, or how many downlevel pages there will be at any given time.
ONTO THE QUESTIONS:
1. Has anyone else ever come across this?
2. How did you do it?
3. Is there a better way of doing it? (IE arrange my table differently)
4. AM I CRAZY?
5. AM I STUPID?
I know 4 and 5 may have opened the can of worms, but am I missing something obvious, or is this just something that is really hard to accomplish?
Thanks in advance for any help you give, or any comments you leave... Sorry for the book!