Editing Pages just once will affect whole site....How do I do it?

liunx

Guest
Hello...<br />
<br />
I know if you have frames, you can just have one page for say the header, footer, and sidebar. You edit it, it changes all the pages.<br />
<br />
What if I want to use regular .html files, and call up pages? I know there is something like<br />
<br />
<!--# include virtual="/footer.html" --><br />
<br />
Does that work with .html pages?? I am going to have over 20 pages, and I do not want to edit each one when I change the site sidebar, since I will be doing that often....Thanks.<!--content-->it should work if your server allows SSI tags to be used, most do. Most servers will only parse pages with SSI tags that have a specific file extension, which is usually:<br />
<br />
.shtm<br />
.shtml<br />
<br />
so you probably need to change the file names to include the s (.shtml) on pages with SSI tags. Your other pages, the ones that get called, can be named .html<!--content-->you could also use some java-script, something a little like this:<br />
<br />
<SCRIPT language="Javascript" src=http://www.htmlforums.com/archive/index.php/"yourfile.js"></SCRIPT><br />
<br />
you'll just need to learn some simple java-script to encap your html code like:<br />
<br />
<SCRIPT LANGUAGE="javascript"><br />
document.write("<font>add your html here</font>")<br />
document.write("next line of code here")<br />
</SCCRIPT><br />
<br />
jaeman}:-)<!--content-->Although I think javascript is cool, I think it would be best to do it server side. Some people disable javascript because it can get annoying if use improperly. <br />
<br />
I would either use the SSI version w/ .shtml/.shtm extentions or you could use php if it is availible on server. Heres what you use to call the file:<br />
<br />
<br />
<? php include("your_file.html"); ?> <br />
<br />
The file containing the content can be any extention (htm, html, php, etc...)<!--content-->Originally posted by GreyBoy <br />
Although I think javascript is cool, I think it would be best to do it server side. Some people disable javascript because it can get annoying if use improperly. <br />
<br />
<br />
Bang on greyboy, people for many reasons including that it can be annoying DO turn javascript off, if you have your navigation in javascript it would render your site absolutely useless to these people!!<!--content-->Oh yeah, I forgot to mention. If you use the php code, you can use include() or require(). The only difference is using include(), if it cant find the file for some reason, the script will not execute at all. If you use require(), the script will execute the best it can with out the file. Also, remember to rename the page contain the include()/require() script to the php extention.<!--content-->i must agree with leoo24 on that a lot of sites/progm's do use java-script because of the ease & speed of the script interpretted by your browser, if i turned mine off i wouldn't be able to view a lot of the sites i set up, one thing though i must admit is annoying is java & java class applets when you are using an old machine it just churns the HDD & goes into over time plus, now thats worth avoiding if anything... jaeman:P<!--content-->
 
Back
Top