How Do I put a Template on Every Page Of My Site?

Discussion in 'HTML & Website Design' started by jab, Jul 9, 2007.

  1. #1
    Please help.

    When building my site, how do I put the template on each page.

    It is on the index page, but I want to put it on the other pages too.

    Do I have to keep dragging the images into Dreamweaver under the file? For example a page called sample.html
    If I want the template there is there and easy way to do this, bearing in mind the template is already in Dreamweaver?

    Thx for your help,

    Jab
     
    jab, Jul 9, 2007 IP
  2. Arnold9000

    Arnold9000 Peon

    Messages:
    241
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I don't know about dreamweaver, but the right way to handle a situation where the same exact info is repeated on numerous pages is through what is called a server side include.
     
    Arnold9000, Jul 9, 2007 IP
  3. jab

    jab Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    How would I perform this?

    Regards

    Jab
     
    jab, Jul 9, 2007 IP
  4. Amilo

    Amilo Peon

    Messages:
    624
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #4
    If its the whole template then just rename sample.html and make your changes.
    If its just a section of the template then save that section as a .php file and call it each time in your template with an include.

    show me your site and tell me what it is you want to do.
     
    Amilo, Jul 10, 2007 IP
  5. haruko764

    haruko764 Peon

    Messages:
    25
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Includes aren't too hard.

    Read this:
    http://www.php.net/manual/en/function.include.php
    And you'll be golden.

    Be warned, though: includes won't show up when previewing the page off of your hard drive unless you are running Apache with PHP installed. They will show up once you upload your site, though.
     
    haruko764, Jul 10, 2007 IP
  6. LeetPCUser

    LeetPCUser Peon

    Messages:
    711
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Usually you would make a second page, copy the code from the first, and paste it into the second page. If you used PHP you could make a header and a footer and then call them every time so you didn't duplicate the code. However, for this purpose just cut and paste and change the content.
     
    LeetPCUser, Jul 11, 2007 IP
  7. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #7
    .Net has the Master file to handle the issue.

    Create the template first and it is saved as a .master file with content controls for where you want the individual pages content to go.

    In the "page" files, you simply have the content controls with the content within it (most pages only have a single content control) and can set the header items such as page title and so none of the template contents other than the name of the master file.

    When you browse to a page, the server merges the page and master file to output the content.
     
    AstarothSolutions, Jul 11, 2007 IP