Forum Moderators: not2easy

Message Too Old, No Replies

reusing pages.. not recoding everyone

         

jaa1180

3:17 am on Sep 19, 2004 (gmt 0)

10+ Year Member



I know there is a way of outlining the page and then taking the top half of the page and put into one htm doc and then the bottom half into another. Then just referance the top and bottom in each new page so as not to recreate each page from scratch...
Question:
What is the code for this?

Jon_King

2:41 pm on Sep 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I use either the Dreamweaver template feature or a Server-Side Include file for each repeating area. An example of SSI code would be:

<!--#include file="topmenu.html" -->

topmenu.html in this example would be the html needed for the top menu bar and this file could be easily modified affecting all pages that use it instantly.

jaa1180

10:11 pm on Sep 19, 2004 (gmt 0)

10+ Year Member



So I would just use an #include statement in the area that would normaly house the header and footer... right?
#include file=top.html
content..
content..

#include file=bottom.html

Am I thinking right?

Jon_King

11:39 pm on Sep 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes. Don't forget the <!-- and -->

Also, typically you use the file extention .shtml (for the main file calling the html) and have your hosting company allow certain code within these files to run. If you just tell your hosting company you have .shtml files with SSI's in them, they will set the correct server parameters so it all works.

sri_peru

5:55 am on Sep 20, 2004 (gmt 0)

10+ Year Member



othewise u can set yourself .shtml extension on .htaccess file
am i correct?

Jon_King

1:37 pm on Sep 20, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That is correct.

jaa1180

2:27 pm on Sep 20, 2004 (gmt 0)

10+ Year Member



zooom... right over my head. .htaccess?
is there some info pages I can read about this?
I am just a basic HTML guy...

Jon_King

4:29 pm on Sep 20, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



jaa1180,

sri_peru is talking about operating your own server and how to set it up correctly.

coho75

4:37 pm on Sep 20, 2004 (gmt 0)

10+ Year Member



There are plenty of places here and on the net that you can find good information about .htaccess files. It sounds like a difficult thing, but they really aren't that hard to use. Just search Google for '.htaccess'