ScoobyNet.com - Subaru Enthusiast Forum

ScoobyNet.com - Subaru Enthusiast Forum (https://www.scoobynet.com/)
-   Computer & Technology Related (https://www.scoobynet.com/computer-and-technology-related-34/)
-   -   Simple HTML query (https://www.scoobynet.com/computer-and-technology-related-34/231566-simple-html-query.html)

boomer 19 July 2003 03:33 PM

Is there an equivalent of a C "#include" in HTML??

Thus i could code something like...

MAIN.HTML
---------
#include "TOP_BIT.HTML"

<p>This is general text, that will be different in various files</p>

#include "BOTTOM_BIT.HTML"
---------

Where TOP_BIT.HTML and BOTTOM_BIT.HTML include the bulk of the code for <HEADER>, </HEADER> etc.

I am not after any smart Java or frame stuff. Just an easy way on including similar code across multiple files.

adTHANKSvance

Cheers,

mb

Chris J 19 July 2003 04:37 PM

Don't know that much about html, but you could use php to generate the top and bottom bits of the html, but that would probably require some additional work on the servers part.

Isn't there something called style sheets (or there abouts) that can be used to create a template html page?

rik1471 19 July 2003 05:47 PM

The files will have to be saved with .asp extension, but this should work:

<!--#include file="path to header.htm" -->

<p>This is general text which will be different etc...</p>

<!--#include file="path to footer.htm" -->

Ian Griffiths 19 July 2003 05:49 PM

Yes, its called Server Side Include or SSI for short.

Either that or you could do it very easily in PHP or ASP.

You could also possibly do it with Javascript although I wouldn't go that way due to inpredictability with client browsers etc.

Any problems give me a shout.

SJ_Skyline 21 July 2003 09:19 AM

Just as rik1471 says - although you need to be running on NT webspace - sure your hosting company will get pi$$ed off if you try to run asp pages on Linux! ;)

rik1471 21 July 2003 10:11 AM

Some Linux hosts support ASP.

SJ_Skyline 21 July 2003 10:24 AM

Ours doesn't ;) Had a right mouthfull from some little to$$er saying that I was trying to break their servers!

FFS, we have 2 sites - one as www.domianname.com and one as www1.domianname.com one on NT, one on Linux - easy mistake to upload code to the wrong one! little git accused me of doing it on purpose! :rolleyes:

Don't you just love people! ;):D

boomer 21 July 2003 06:23 PM

Chris J,

i already use Style Sheets (CSS), but that is more for standard layouts, rather than the actual content.

rik1471,

That looks exactly like the kinda thing that i am after, but i'll need to check with my ISP (Demon) that they support ASPs. Trubbul is that i think they use UN*X, so that could be a show stoppa :(

I am presuming that ASPs are some fancy server-side stuff that pre-processes web pages on the fly to feed "final form" HTML to the client? Is this a MicroSnot (insert sound of Spit The Dog ;) ) only facility?

Ian Griffiths,

I want to keep things as simple as possible. I am surprised that as the Internet was "invented" by sandal-wearing, pony-tailed, UNIX folks, they didn't include the "include" idea from square one. Is it kind of naff (although typical of Microsoft) to "hide" functionality in comments :rolleyes:

SJ_Skyline,

time to ask Demon what they support!


Sooooo many options.

Cheers all,

mb


All times are GMT +1. The time now is 06:01 PM.


© 2024 MH Sub I, LLC dba Internet Brands