Implementing Nav Bar Help (Simple Query)

Discussion in 'CSS' started by wd_2k6, Dec 10, 2007.

  1. #1
    Hi there i am currently learning about website design, so sorry for the noobish question but i am currently in the process of deisgning my website.

    The problem is that the code for my navigation bar has to be entered in the body of every page, and therefore i have to edit every single page when i want to change an item in the menu.

    Is it not possible to refer to the menu externally, so that when i change the menu on this single external page that all menu on all pages will update.
    Here is my site in question in case you were confused about the navigaton bar:
    http://ukdesi.ulmb.com/indextest.html

    By viewing the source you can see my long winded implementation of the menu in the body.

    Many Thanks in advance for all help recieved.
     
    wd_2k6, Dec 10, 2007 IP
  2. Jeff Blake

    Jeff Blake Peon

    Messages:
    32
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Does your server support php? If it does, it is precisely what you are looking for.
    Google 'php includes'
    Basically here is how it would work:
    Make a separate file with the nav code.
    Replace that code in your pages with a simple PHP include:
    
    <?php
    Include(file.html.inc);
    ?>
    
    Code (markup):
     
    Jeff Blake, Dec 10, 2007 IP