Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Junior Member jonatec's Avatar
    Join Date
    May 2013
    Posts
    8
    Member #
    36331
    If all my web pages have the same navigation and footer markup, what is the best way of avoid hard-coding this in every page, so if it needs changing it's only changed in one place so as not to have to edit every html file?

    Thanks

  2.  

  3. #2
    Junior Member
    Join Date
    May 2013
    Posts
    6
    Member #
    36292
    Quote Originally Posted by jonatec, post: 251206, member: 36387
    If all my web pages have the same navigation and footer markup, what is the best way of avoid hard-coding this in every page, so if it needs changing it's only changed in one place so as not to have to edit every html file?

    Thanks
    You can include a file with:

    <!--#include virtual="filepath.html" -->

    Just place the "comment" where you would have inserted the HTML code on your page. The file referenced should only contain HTML (no Header, Body, Title etc.).

    Also, I you might have to check your htaccess file on your server to be sure the server allows includes.

    I had to include these lines in an .htaccess file:

    AddType text/html .htm .html
    AddHandler server-parsed .htm .html

    Server is running Apache. This will force the web server to parse every .htm and .html file for includes, which will slow down the server, but I didn't notice any lag. Hope this helps. I am no expert, but I just got done doing this exact same project.

  4. #3
    Junior Member
    Join Date
    May 2013
    Location
    Sydney Australia
    Posts
    23
    Member #
    36308
    Just copy & paste, then rename file, and change the content & menus as needed, I take it your not using a CMS.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 05:45 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com