View Full Version : tables - changing pages


Buffy
05-22-2003, 10:44 PM
I'm creating a site using tables, I have the contents down the left and I was hoping for the content to go in the middle cell. However that means that for every content link I want to click on I have to create a whole new html page with all the html etc. repeated. But on the right side I have things that will need to be updated more frequently, this would mean I have to update every single page of content? Is there anyway around this I'm missing? The only similar style I can find for an exapmle is http://www.celebrity-exchange.com See the way she has the links on the left and the content appears in the middle, similar to that? But would I have to update every page?

I hope this makes sense?
xx

amicus
05-22-2003, 11:08 PM
use ssi or php include for the stuff that will repeat. all you have to do is include it into every page. then once you make a change to anything that's being included it'll be changed on all the pages.

Buffy
05-22-2003, 11:27 PM
Oh lordy! I don't think I've ever used them before!! Can you point me somewhere to explain it or something?

Thank you xx

amicus
05-22-2003, 11:32 PM
here's one by apache, skip over the configeration stuff 'cos you're not setting up a server :)

http://httpd.apache.org/docs/howto/ssi.html

Buffy
05-22-2003, 11:53 PM
I shall take a looksie... thank you very, very much!! =)

Buffy
05-23-2003, 12:14 AM
Sorry for double posting...

Okay I've had a look at it, I guess the 'include a footer' is the section I'm after and this is what I want <!--#include virtual="/footer.html" --> I include that on all pages, yes?

I don't really know where to go from there?

amicus
05-23-2003, 12:20 AM
you don't the footer, you want the footer concept :) any part of your website (navigation menu, images, logos, etc.) that are on every page you want to use the:
<!--#include virtual="/menu.shtml" -->

basically you want to replace the menu with the include that way it'll be included when the page is parsed. you'll also need a host that can support ssi or php.

it's a bit of a learning curve but once you get it it's super easy. then you'll be kicking youself wondering why you thought it was so hard :)

Buffy
05-23-2003, 12:24 AM
Hehe yes isn't that always the way!! :)

That makes a little more sense, I'm going to have a news coloumn in one cell, which I want to appear on every new page loaded, so how does it work for something like that in cells?

Thanks xx

amicus
05-23-2003, 12:31 AM
you want something similar to this. on the left cell is the include (on all page) on the right is the content.

<table width="100" height="100" cellpadding="0" cellspacing="0" border="1">
<tr>
<td>test<!--#include virtual="/news.shtml" --></td>
<td>content here</td>
</tr>
</table>

Buffy
05-23-2003, 12:37 AM
Oh I see! I'll try it out!

Thanks again! xx

Buffy
05-23-2003, 01:40 AM
Ah it didn't work! I must have done something wrong!

I tried it out... in the one sell I was planning to have a poll, so I set the poll up in the cell on the index page. Then on a nother page I made exact to the index excpet for the main content was different and I left the poll off. I added the code to where the poll should be and it didn't work.

What did i do wrong?

amicus
05-23-2003, 02:02 AM
did you create a news.shtml page to include? and does your host support ssi. make sure the path is correct. if it's all ok then try:
<!--#include file="/news.shtml" -->

Buffy
05-23-2003, 06:13 PM
Yes it supports SSI. I did it with the poll instead of the news, as I haven't done the news yet.

I'll try and explain better how my site works... On the left there are several cells going down including things like content links and stuff. In the centre is a big cell that when a link in the content is clicked that content will appear in the centre cell. On the right is several cells again containing news updates and a poll etc. When a content link is clicked on the left I want it to appear in the centre cell, leaving the left and right cells with the same info, so when I update news, which will be quite frequently i don't want to have to update in every single page of content.

Riht you know all that I just wanted to explain it better just in case.

So anyway, because I have no news yet I created a poll and added it to it's cell on the right on my index page. Now instead of going through all the pages i've done so far and adding it to the cell everytime, like I would have to do for the news I want to use the code instead so it updates on every page itself. Does that make sense? I must be putting the code in the wrong place because it's not working.

amicus
05-24-2003, 03:43 AM
ok i'm back, i was super duper sick so i had to take a day off work :(.

anyways, i'm not sure why ssi didn't work but we can try inline frames. it's not as good as ssi but it'll work. iframes may have problems in some older browsers but it's easier to understand. if you're paying for ssi i'd recommend you use it but for now the iframe will work too.

here's the code, as you can see the 'iframe' tag is replaced with the poll.html page. once you click on the 'news' link the iframe changes 'cos we target the iframe. it works almost the same way ssi except it's done on the client side.

index.html
<html>
<body>
<table width="*" height="*" cellpadding="0" cellspacing="0" border="1">
<tr>
<td>
Navigation<br>
<a href="poll.html" target="inlineFrame">Poll</a><br>
<a href="news.html" target="inlineFrame">News</a>
</td>
<td><iframe src="poll.html" width="100" height="100" marginwidth="0" marginheight="0" frameborder="0" name="inlineFrame"></iframe></td>
<td>right content</td>
</tr>
</table>
</body>
</html>

poll.html and news.html (both are built the same way)
<html>
<body>
post
</body>
</html>

Mike
05-24-2003, 10:45 PM
Is it possible to do this with just PHP, no SSI?

Dude128
05-25-2003, 01:47 AM
if all you want to do is include another page (exactly like SSI), you can use the following code:

<?php
include 'pagename.ext';
?>

amicus
05-25-2003, 02:15 AM
yes, you didn't say you had php that's great :). php would actually be better then ssi. it's done the exactly the same way as ssi but with different syntax.

i guess dude128 beat me to it :)