Click to See Complete Forum and Search --> : Loading files data into table cells?


GFORCE100
06-13-2003, 04:56 PM
Hello people,

I have this issue and am hoping you can provide a solution. I think this can be done with javascript easily, just a question of knowing how it works.

I have a table that is made up of many cells, these hold mostly the website graphics of my site. This makes up a template I use for all pages forming the full website (up to 20 or so). Some of these cells are to be static (the same) across all pages. My idea is to fill these static cells dynamically by letting them load their info from another html/standard file. This will mean that when I'm updating I don't need to go through each and every page changing the same cells over and over.

Does anyone catch on yet?

Frames pop into my head but frames in tables? I've never heard of that before.

Perhaps some of you are experienced enough or kind enough to provide your own code snippets as examples or links to exactly what's needed here for it all to work.

Also, maybe some other approaches are better? If so do tell, I'm just sugesting my own, obviously not always the best.

Many thanks guys,
Adam

Jona
06-13-2003, 05:18 PM
There are many ways to do it. First of all, you can use IFrames (http://www.w3.org/TR/html401/present/frames.html#edef-IFRAME), you can use SSIs (<!--#include file="htmlFileToInclude.html"-->) if your server supports it (and if your document's extension is .shtml instead of .html), or you can use PHP (<?PHP include_once("file.html"); ?>) if your server supports PHP (and if your document's extension is .php instead of .html).

Jona

Alien Man
06-14-2003, 06:54 AM
A Java servlet is made to do this with ease. An entire site can be run from one servlet with as many pages as you want.

GFORCE100
06-14-2003, 10:30 AM
But which of these is the simplest?

I think some include page code inserted into the given cells would be best.

The server does support CGI and PHP but could it be kept simple to javascript? This way its not so hosting account feature dependant.

Jona
06-14-2003, 02:42 PM
You will definitely need a server that parses documents before it sends them to the client. So you'd have to use SSIs, that is the simplest way to do it. I posted the code above.

Jona

GFORCE100
06-15-2003, 09:53 PM
Right I tried the SSI method and this the error message I got displayed inside the given cell when uploaded do the server:

There is a recursive #INCLUDE chain

I called the main page index.shtml

The HTML code I pasted it inside the cell is:

<!--#include file="start.htm"-->

Hmmm

Jona
06-16-2003, 10:14 AM
You might want to take a look at this (http://www.ucsf.edu/its/web/ssi.html) link.

Jona

GFORCE100
06-16-2003, 10:30 AM
Very useful thanks.

I got it working with PHP.

If you have any other tips on how to make a website template to be as easy as possible to update that would be great. It's a bit like a news feed website plan I agree, but I'm doing a software website where lots can change, espcially knowledge base technical support solutions to problems.

I'm also in the hunt of how to minimize the need for the browser to download the website graphics on each page (they are mostly the same).

I realize frames would do it but I can't see it being that simple with a table made up of so many (20 or so) cells. Only 1 cell (the large center one) will need to reload with the users given selected link (for example technical support section of website).

Jona
06-16-2003, 10:33 AM
PHP or SSI is the best way to go for what you want--probably. But you might want to take a look into XML.

Jona

GFORCE100
06-16-2003, 10:47 AM
Right. Finalizing the template is the worst bit. I'm better at making sites look good than their technical side. I'm a programmer really, not a web guru.

Thanks

Jona
06-16-2003, 11:02 AM
*In the voice of Yoda, "Welcome you are."* :D

Jona