How do do web design where table of contents, header, etc. is separeate from content?

Discussion in 'HTML & Website Design' started by Mike Andorra, May 5, 2009.

  1. #1
    Web design noob here...

    Is there a way to do web design where certain elements in the template like the table of contents, header, footer, etc. exist separately from the content? I want to do this so that if I ever want to change something in the header, for example, I only have to make one change instead of making it on every page.
     
    Mike Andorra, May 5, 2009 IP
  2. Vekseid

    Vekseid Peon

    Messages:
    124
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Yes. Pretty much any CMS offers this, but many write their own lightweight CMS. You can also do it with SSI using virtual includes, but that's a bit hacky.
     
    Vekseid, May 5, 2009 IP
  3. JyeP

    JyeP Active Member

    Messages:
    329
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    78
    #3
    Make 3 files.
    2 of them can be PHP files header.php and footer.php
    The third file is index.html

    Add all your header info into the header.php and all the footer info in the footer.php.

    Then all you need to do is include those 2 files into each html page.
     
    JyeP, May 5, 2009 IP
  4. Immaboy

    Immaboy Peon

    Messages:
    47
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Adding on to what the above had said, you could either use php include or ajax include (Of course, you've to be on a .php page to include php, could just use a normal .html page if you use ajax include). Google them for more information. :)
     
    Immaboy, May 6, 2009 IP