...

View Full Version : HOW-TO common parts of an HTML page



mbl
11-02-2004, 05:47 PM
Good friends,

This is a question on fundamentals, not on details yet.

The HTML pages in question are typical and simple in that they would consist, each, of:

---------------------------------------------------
Top-Part (Code is same for all),

Middle-Part (Code is DIFFERENT for each page), and

Bottom-Part (Code is same for all).
----------------------------------------------------

Is there a way (or more than one) to have only ONE Top-Part and only ONE Bottom-Part that is called by the page-in-question which would basically consist of the Middle-Part and calls to the Top and bottom parts?

This means that a change in the Top-Part or in the Bottom-Part would reflect in as many HTML pages as used them right away, with no need to go and change any of the pages that call them.

Thanks a lot.

-mbl-

fci
11-02-2004, 05:54 PM
use a server-side language such as PHP.


<!-- top content / body tag/ etc -->
<?php switch / if / whatever which will lead to variable content ?>
<!-- bottom content / footer-->

mbl
11-02-2004, 08:41 PM
use a server-side language such as PHP.


<!-- top content / body tag/ etc -->
<?php switch / if / whatever which will lead to variable content ?>
<!-- bottom content / footer-->


Thanks, FCI.

Am not at that level, though, unfortunately.

Any other way? How about Frames (which still would need to study, and plan-to). Could frames load themselves with fixed data?

Or something like layers (like photo-shop, concept only)?

Thanks.

-mbl-

Willy Duitt
11-02-2004, 09:03 PM
This is not a javascript question and should be moved to the CSS/HTML forum... Please do not cross-post but rather contact a moderator and request that your post be moved to the correct forum....

.....Willy

Roy Sinclair
11-02-2004, 09:13 PM
Use Server Side Includes (SSIs), contact your service provider to find the specifics for using SSIs (usually naming the pages *.shtml or similar).

See: http://www.netmechanic.com/news/vol2/server_no8.htm

mbl
11-02-2004, 09:40 PM
This is not a javascript question and should be moved to the CSS/HTML forum... Please do not cross-post but rather contact a moderator and request that your post be moved to the correct forum....

.....Willy

Sorry, Willy.

Being an ignorant, how can one know that there is or not a Javascript answer?

Thanks.

-mbl-

fci
11-02-2004, 10:20 PM
Sorry, Willy.

Being an ignorant, how can one know that there is or not a Javascript answer?

Thanks.

-mbl-

I'd say this is a PHP queston. If you don't have access to PHP .. there is a way to do it in JS but I wouldn't recommend it.

joh6nn
11-03-2004, 12:48 AM
I'd say this is a PHP queston. If you don't have access to PHP .. there is a way to do it in JS but I wouldn't recommend it.

agreed; this is doable with javascript, but that should be a last resort; javscript wasn't intended for this use, and won't work nearly as well as a server side language. if you absolutely can't use a server side language, or can come up with a compelling reason why you need to do this with javascript, we'll help you do it, but otherwise, i'd like to move this to the Server Side forum.

AaronW
11-03-2004, 12:57 AM
A better method would be to have the top and bottom page call the middle pages ;) That way when you want to change your top and bottom more drastically, you won't have to touch every other page.

mbl
11-03-2004, 07:35 PM
agreed; this is doable with javascript, but that should be a last resort; javscript wasn't intended for this use, and won't work nearly as well as a server side language. if you absolutely can't use a server side language, or can come up with a compelling reason why you need to do this with javascript, we'll help you do it, but otherwise, i'd like to move this to the Server Side forum.

Good friends,

As said, it was not a question about details. Only a direction was being requested. It is irrelevant if moved, therefore, to where it may belong better.

The direction is given, understood as very good, and appreciated as such.

Thanks, every one.

-mbl-



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum