how do I make a menu?

Discussion in 'HTML & Website Design' started by tdg89, Jun 28, 2009.

  1. #1
    Hi,

    I want to make a navigation menu for my website. This menu will be displayed on 20 pages. I want to be able to modify this menu on all pages in just one document. Is this possible? If so, how?

    Regards.
     
    tdg89, Jun 28, 2009 IP
  2. pipes

    pipes Prominent Member

    Messages:
    12,766
    Likes Received:
    958
    Best Answers:
    0
    Trophy Points:
    360
    #2
    Do you want something basic or fancy?

    Regarding modification that is done within the CSS file, once the navigation has been created and styled with CSS.
     
    pipes, Jun 28, 2009 IP
  3. Astroman

    Astroman Well-Known Member

    Messages:
    2,355
    Likes Received:
    71
    Best Answers:
    0
    Trophy Points:
    135
    #3
    If you mean you want to add extra links to your menu and have it update the whole site from one file, then using php files is a good way to go. So you have your menu in a menu.php file then use <?php include 'menu.php'; ?> where you want the file content to display in your other php pages.
     
    Astroman, Jun 28, 2009 IP
  4. hkarakis

    hkarakis Active Member

    Messages:
    58
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    91
    #4
    you can solve this with php. Make yoru navigation menu in one document and include it all your pages. When you make changes on your navigation page it will be enough.. Search include function.
     
    hkarakis, Jun 28, 2009 IP
  5. wd_2k6

    wd_2k6 Peon

    Messages:
    1,740
    Likes Received:
    54
    Best Answers:
    0
    Trophy Points:
    0
    #5
    You should also consider the same concept for a header and footer and possibly sidebars.
     
    wd_2k6, Jun 28, 2009 IP
  6. HighRankingSEO

    HighRankingSEO Well-Known Member

    Messages:
    423
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    125
    #6
    HighRankingSEO, Jun 28, 2009 IP
  7. dcristo

    dcristo Illustrious Member

    Messages:
    19,797
    Likes Received:
    1,201
    Best Answers:
    7
    Trophy Points:
    470
    Articles:
    5
    #7
    It's possible to do this with php includes (.php pages) or server side includes (.shtml pages). If you need to run other php scripts then it's best to go with php pages. All you have to do is edit the common header/footer include and it will update on all pages.
     
    dcristo, Jun 28, 2009 IP
  8. tdg89

    tdg89 Peon

    Messages:
    215
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Thanks guys. My explanation wasn't very clear, but php is what I was looking for.
     
    tdg89, Jun 28, 2009 IP
  9. HivelocityDD

    HivelocityDD Peon

    Messages:
    179
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #9
    You can check the script name (current page ) using $_SERVER[PHP_SELF] and then you can check whether its your needed document using strpos()

    You can implement a condition checking inside the menu.php file which you include in all pages as header section or side bar section.
     
    HivelocityDD, Jun 28, 2009 IP
  10. Cash Nebula

    Cash Nebula Peon

    Messages:
    1,197
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Cash Nebula, Jun 28, 2009 IP