Help with auto-generated menu

Posted on 2006-04-01
Last Modified: 2006-11-18
Using the Auto-generated menu here that reads [h#] for the menu:

How can I do this from outside the file, with many files?

For example, I have a standard menu included in each file, that has a link to each file.  I would like to include a submenu based on the headings of each file as the above link does.

For example


Introduction link
  - link to H2 (1)
  - link to H2 (2)
  - link to H2 (3)
Page1 link
  - link to H2 (1)
  - link to H2 (2)
  - link to H2 (3)
Page2 link
  - link to H2 (1)
  - link to H2 (2)
  - link to H2 (3)

Question by:galneweinhaw
    1 Comment
    LVL 49

    Accepted Solution

    You wouldn't want to do that on each hit, because your website would become very slow because of the number of files that need to be accessed on each and every request..

    When you realy need this kind of setup it is usually better to only show the main menu items, and show the subheader only when you are in the corresponding file.
    Another approach might be to use caching, but this would still involve a large amount of file/hard disk interaction.

    A third way is to hardcode the menu, or drive it from a database.


    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Suggested Solutions

    Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
    These days socially coordinated efforts have turned into a critical requirement for enterprises.
    The viewer will learn how to dynamically set the form action using jQuery.
    The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now