Database-generated nav menu?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I'm building a site that will display information on about 50
products. On each product page there is a right-hand nav menu linking
to various related documents. I would like to have this menu generated
from an external file, thus enabling me to quickly change the contents
of the menu when the need arises.

Though the menu structure is the same for each page, the files that
the menu links to differ from product to product. I'm not that
familiar with databases but suspect that I should be looking in that
direction to solve this problem.

I'm not looking for someone to explain the whole thing to me, only to
pointed in the right direction and perhaps some useful advice.

Any input would be appreciated.


Re: Database-generated nav menu?

In article wrote:

Quoted text here. Click to load it

If you don't use a database, you'll have to build a sidebar menu for
each product out of static files which you'll be able to edit.  If you
have 100 products, that's 100 files to have to modify if you need to
make any sort of global change unless you're Really Good(tm) with UNIX
file manipulation tools.

If you store the requisite links in a table (say, called sidebar) keyed
by product code, it's easy to pull up the entries with a single query.

DeeDee, don't press that button!  DeeDee!  NO!  Dee...
[I filter all Goggle Groups posts, so any reply may be automatically by ignored]

Re: Database-generated nav menu?

In article wrote:

Quoted text here. Click to load it

You say the menu is the same structure, how about an example of a few
pages to illustrate with URL? I have found it to be very convenient with
commercial sites that have different sections (each with a class of
products) to have the menu as an include (I use a php one) and they can
then be changed easily whenever there is a change in the client's
products. But you might describe with an example for further discussion.


Re: Database-generated nav menu? wrote:
Quoted text here. Click to load it

I use a files-based CMS where each "page" is actually a directory
that contains html fragments, where each such fragment gets stuffed
into a <div> (#header, #footer, #main-disp, #aux-disp, #globalnav,
#localnav) using file_get_contents($divpath)

#globalnav is a horizontal bar of css dropdown menus, that never
change (same on every page, no matter what).

#localnav is a navigation bar that can be customized on a per
page-group and/or per-individual page basis.  Those links also
come from file_get_contents()

/templates/dirs/tools/handtools/_-chisels  (tools is a dir, chisels is a

The leading _- before chisels tells the system this is a leaf-level page
to create.

The _-chisels dir contains a collection of div fragments,
plus link lists. This system wasn't hard to write and it works well for me.

the link would be ?page=tools/handtools/chisels

Re: Database-generated nav menu?

On 22 Aug, 16:32, wrote:
Quoted text here. Click to load it

You could use one include file for the menu, an in the included file
make a switch between the menus basted on the URL. A database
would work, but it is not necessarily the best option.

Site Timeline