#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    1
    Rep Power
    0

    How to make a page on a website follow a layout from another file in HTML?


    I am making a website but I am having a problem, later on I want to be able to change the layout without going through every HTML file, such as the layout (Such as the top navigation bar) being held in another file, so if I edit that file it changes all of the pages. Is there a way I can do that?
    Also I would prefer if there was no server side scripts as the hosting I am using disallows it.
  2. #2
  3. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,317
    Rep Power
    7170
    I suggest finding a new host. There is no way to do that with just HTML and no efficient way to do it without a server side script.
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  4. #3
  5. CSS & JS/DOM Adept
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2004
    Location
    USA (verifiably)
    Posts
    20,124
    Rep Power
    4304
    Spreading knowledge, one newbie at a time.

    Check out my blog. | Learn CSS. | PHP includes | X/HTML Validator | CSS validator | Common CSS Mistakes | Common JS Mistakes

    Remember people spend most of their time on other people's sites (so don't violate web design conventions).
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Location
    India
    Posts
    3
    Rep Power
    0
    There's two really bad workarounds for this:

    1. use framesets (deprecated, don't)

    2. print the menu in a separate javascript file and include it in the html documents:

    <script type="text/javascript" src="my_menu.js"></script>

    Basically, in my_menu.js it says:

    document.write("<a href='home.html'>Home</a>");

    etc.

IMN logo majestic logo threadwatch logo seochat tools logo