--- Gerry Jones <[EMAIL PROTECTED]> wrote:
> I want to create a menu/navigational section for a website I plan on 
> building, and I would like to know if there are any easy-to-use modules I 
> could use, or if there's another way. My website will have many levels and I 
> don't fancy copying, pasting and tweaking the HTML to get the menu to look 
> right on every page. I need someway that will make life easier, that will 
> preferably, automatically include new pages.
> 
> TIA,
> 
> Gerry.

Gerry,

Due to the number of responses that you have received, I'm sure you realize that there 
are many
ways to do this.  As for myself, I have built some rather large database driven Web 
sites with
Template Toolkit and I find that I like to have the navigation system stored in the 
database as a
node structure.  With one root level node, you can have a table listing all nodes, 
each listing a
parent node and title.  The table would look something like this:

Node Parent Description
---- ------ -----------
1    1      Home
2    1      Poets
3    1      Ex-girlfriends
4    2      Ovid
5    2      John Davidson
6    2      Tennyson
7    3      Lainie
8    3      Carrie

This breaks down as (this will show up with a fixed-width font):

       1
    /     \
   2       3
 / | \    / \
4  5  6  7   8

In this system, you can see how my favorite poets each fall under the number 2 node, 
while my
ex-girlfriends (this is an abbreviated list, trust me) fall under the 3 node.  Want to 
drill down
from number 2?  Select all nodes who list 2 as a parent.  Want to go back up?  Select 
2's parent. 
Need to find all nodes on a particular level?  Select all nodes with the same parent.

If you want documents in those nodes, create a documents table which contain the node 
ids that
they apply to.  You can either serve your docs out of the database or just have the 
paths in
their.  This system is fairly flexible and easy to control.

Cheers,
Curtis "Ovid" Poe

=====
Senior Programmer
Onsite! Technology (http://www.onsitetech.com/)
"Ovid" on http://www.perlmonks.org/

__________________________________________________
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to