Include a Template file in a HTML file

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • jjmao1
    Sergeant

    • Apr 2007
    • 31

    Include a Template file in a HTML file

    All my pages are static HTML pages now. I have to modify every file if I want to change head, footer, navigation menu, etc. I want to create a template file in in either template.php or template.html and I can call this template file from each HTML file. I want to keep my HTML file names and don't lose all search engine index, backlinks, and bookmarks, etc.

    Anyone has done this successfully? Can you tell me how did you do it?
  • Watdaflip
    Major General

    • Sep 2005
    • 2116

    #2
    Re: Include a Template file in a HTML file

    Only way I can see doing this with bluevoda is by making all of your pages .php, and using the include() function to include your website template.

    Naval has a tutorial on doing this with a menu, I don't see why this won't work with everything but the content. You will have do use the method of making certain parts of the page a function, if you include the entire file the page won't turn out right (two pages with all the html jumbled isn't going to turn out well)

    Register/Login Script
    Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script

    Comment

    • jjmao1
      Sergeant

      • Apr 2007
      • 31

      #3
      Re: Include a Template file in a HTML file

      I have tried this method. It works fine. But I don't want to change all the files from .html to .php. In that case, I will have to lose all the page index, backlinks, bookmarks, etc. I can get index from major SEs quickly, but not other things. If I redirect all the files from .php to .html, I am afraid my Adsense account will get banned.

      Black Panther Animal
      PBS Kid Games

      Comment

      • Watdaflip
        Major General

        • Sep 2005
        • 2116

        #4
        Re: Include a Template file in a HTML file

        HTML isn't a dynamic language. There is no way to dynamically include a template with HTML. The closest you can get is using a frame or iframe. Using frames would be even more detrimental to you search indexing then changing your extensions to .php would.

        There is a way to do extension masking with .htaccess (so you can make a .php load as a .html (server still excutes as .php, but it shows in the address bar as .html), I don't know the code offhand, but I'm sure it would come up in a google search

        Register/Login Script
        Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script

        Comment

        Working...
        X