Results 1 to 2 of 2

Thread: Template Synchronization

  1. #1
    Join Date
    May 2009
    Posts
    2

    Template Synchronization

    I want to know if there is a way to synchronize your template file for your website.

    That way if you wanted to change the top banner on say 10 pages that you used to template to create, could you change it by changing one file? or do you have to go change each one separately.

    I use dreamweaver

  2. #2
    Join Date
    Feb 2006
    Location
    Salisbury UK
    Posts
    4,332
    The best way to include code that repeats on several pages is to use an "include" file either with SHTML or preferably PHP, then you only have to change one file, the "include" file, and it changes all the main pages.

    Remove the banner code from all your pages and insert
    <?php include ("header.inc"); ?>

    then put the banner code in a separate file called header.inc (in the same folder/directory) - no doctype, html, head or body tags, just the banner code.

    then rename all your main pages with .php filename extension instead of .html

    You need to check that your host supports php and you won't see the full page with the banner on your local computer unless you download WampServer 2 which includes an Apache server because the php code has to be processed by a server, either your host's server before someone downloads the page or Apache on your computer.
    See http://www.wickham43.net/serversideincludes.shtml
    Code downloaded to my PC will be deleted in due course.
    WIN7; IE9, Firefox, Opera, Chrome and Safari for Windows; screen resolution usually 1366*768.
    Also IE6 on W98 with 800*600 and IE8 on Vista 1440*900.

Similar Threads

  1. Template prob with DIV tag?
    By laksh_khamesra in forum General Questions
    Replies: 1
    Last Post: 30 Apr 2008, 11:26 AM
  2. Need this image to be turned into a template
    By Filter in forum General Questions
    Replies: 1
    Last Post: 27 May 2007, 01:08 AM
  3. Template Ruined
    By ChrisParr in forum Web Design, HTML Reference and CSS
    Replies: 1
    Last Post: 28 Jun 2006, 05:11 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •