PDA

Click to See Complete Forum and Search --> : Include Footer


RobDog888
Jun 10th, 2005, 02:27 PM
Ok, semi-n00b here :blush:, but I dont want to use frames and I want to have a single footer to include across all my pages
in the bottom row of a table.

I am using notepad and basic html. I was using some JS but it would invoke an unsafe code alert in IE so
I want to avoid it if possible.

Thanks.

CornedBee
Jun 10th, 2005, 02:39 PM
You have a few options. I've ordered them by the amount of server support you need, from least to most.
1) Use some snippet include system that you have in your editor, that runs through all your files and simply includes another file in them. The jEdit editor has a plug-in called xInclude that does that. ( http://www.jedit.org/ ) Pro: You don't need any server support. This means you can do this really everywhere. Con: When you change the included bit, you have to re-run the plugin for all your pages. You also need to run the thing for every page you make before you can upload it. You have to run it for the pages you change, which makes testing tiresome. (You can't just edit and reload, you have to rebuild first.)
2) Server-side Includes (SSI). Works exactly like 1), except that the server does the including on request. This means that you upload only the part files. Pro: Very fast and simple for such simple jobs as yours. Ideal solution for you if the server supports it. Con: Requires the server to understand SSI. Some don't or have it disabled.
3) Full-blown server-side scripting. Overkill for you. Worse chances that it's supported than SSI, while providing no advantages in your case.

RobDog888
Jun 10th, 2005, 02:43 PM
Thanks for your quick response CornedBee. :)

Sounds like I will choose whats behind curtain #2.

So, now how do I find out if its supported and how o I use it?

Thanks


Edit: when you say you upload only part files do you mean you only upload the include file and not the entire page, correct?

CornedBee
Jun 10th, 2005, 02:48 PM
You upload the include file and the file that includes it, but not, as in 1), a version of the page where the footer is already included.

OK, where do you host your pages?

RobDog888
Jun 10th, 2005, 02:51 PM
That is yet to be decided. The client originally wanted to have the site uploaded to their ISP's space but we are going to
recommend them host it on their SBS 2003 server.

I will be hosting it during development here at our office's server until then though - Server 2003.

CornedBee
Jun 10th, 2005, 03:15 PM
Then it's up to your sysadmin to configure it to allow SSI.

RobDog888
Jun 10th, 2005, 03:25 PM
Ok, when he gets back in I will ask him to set it up. Until then have any sample code or the syntax I need to link the page
footer to the table cell?

sciguyryan
Jun 11th, 2005, 06:03 AM
Ok, when he gets back in I will ask him to set it up. Until then have any sample code or the syntax I need to link the page
footer to the table cell?


Do you have PHP available on your server?

PHP makes things very easy for things like this, by renaming the file to a .php extension you could do this:


<table summary="" border="1">
<tr>
<td>red</td>
</tr>
<tr>
<td><?php include("SomePage.html"); ?></td>
</tr>
</table>


Would that be a better solution for you?

Cheers,

RyanJ

CornedBee
Jun 11th, 2005, 06:05 AM
No, it wouldn't. As I said, PHP would be overkill.
Try this:
http://httpd.apache.org/docs/howto/ssi.html

sciguyryan
Jun 11th, 2005, 12:35 PM
No, it wouldn't. As I said, PHP would be overkill.
Try this:
http://httpd.apache.org/docs/howto/ssi.html


But if PHP is already installed on the server it would require less work, thats why I suggested it :)

Cheers,

RyanJ

visualAd
Jun 11th, 2005, 02:19 PM
The SSI functionality in Apache is built into the web server as a module. As such it is a lot more efficient than a server side scripting language which has to be interpreted and executed by a separate process. Even if PHP were built as an Apache module it would still be more feesable to use SSI's instead.