Auto-updating of table cells?

Soldato
Joined
8 Sep 2003
Posts
2,882
Location
Location Location!
Hey there,

I'm in Dreamweaver. Several of my pages contain a table cell that has my latest "news" in it. At the moment I am having to type in the news on one page, then copy+paste it over to the other pages. Is there a - preferably simple - way I can make the content of the cells on all pages children to a single parent? That way I could just update one page, and have the others automatically update.

Cheers, don't worry if it's a ridiculous hassle,
 
Permabanned
Joined
16 Dec 2002
Posts
10,237
you could just write a new page called news.htm and update that, and wherever you need to have them news just put in includes('news.htm') and then you just need to update that one file
 
Soldato
OP
Joined
8 Sep 2003
Posts
2,882
Location
Location Location!
That sounds perfect, but could you explain where abouts I put that command? I haven't used Dreamweaver for long and HTMl is mostly russian to me.

Edit: Hmm, looks like you mean server-side include? I'll take a look...
 
Man of Honour
Joined
31 Jan 2004
Posts
16,335
Location
Plymouth
Freak_boy said:
you could just write a new page called news.htm and update that, and wherever you need to have them news just put in includes('news.htm') and then you just need to update that one file
If you're going to answer, please don't spurt out drivel. You gave the right answer (ish) but didn't explain so now somebody else has to clean up.

It's late, I'm tired, and I finally decided to tell you that. So forgive me :p

OP - what Freak_Boy means is use something like SSI (server-side includes) or PHP to include a single file into other files :)

So what you can do is use PHP, for example, by creating a file called in which lies all the news items (and saveit the same directory as the other website files) and then, in the pages where you want to show the news items, you add this code into the place of the news section:

Code:
<?php include 'news.htm'; ?>
The file will also need a .php extension for the PHP code (the section between the <php and ?> tags) to be parsed by the server.

You could use SSI but PHP can also do many other things which may be a better option as it's more flexible should you want to do other things :)

The only downside to either method is that you have to change the file extensions for all pages using the language - so for SSI you normally need the .shtml extension, whereas for PHP you normally need .php. But that should be a one-time only thing and there might be some batch file renaming tools around :)

So in short...easily possible, bit of a pain to setup at first if you have lots of files. And remember to add the code in Dreamweaver's code view or (I think) it'll save it as actual plain text instead :)
 
Permabanned
Joined
16 Dec 2002
Posts
10,237
Beansprout said:
If you're going to answer, please don't spurt out drivel. You gave the right answer (ish) but didn't explain so now somebody else has to clean up.

I

OR just wait for me to explain it properly :rolleyes:
 
Man of Honour
Joined
31 Jan 2004
Posts
16,335
Location
Plymouth
I'd grab you on MSN if I really wanted to dig into you, don't worry. I was just frustrated with the half-answer you gave considering you've asked for help often and received quite a bit and don't say thankyou.

Anyway - let's not drag this OT even more (those Donnies will notice) - e-mail me if you have a case to argue, otherwise reply to those threads with a thankyou. Or rob will actually cry :p
 
Permabanned
Joined
16 Dec 2002
Posts
10,237
oh right so now i know why you almost always criticise my posts! as i have been wondering why you give me harsh replies! as for the reasons, catch u on msn if i am ever on!

PS> if i really didnt want to help, i wouldnt even have replied in the first instance,or even bother looking at this section whenever i come on ocuk, most of the times there are loads more people who are "better" then me so i dont really get a chance to reply!

oh and atleast i dont come on ocuk only when i need help (not a dig at you but some people)
 
Last edited by a moderator:
Man of Honour
Joined
31 Jan 2004
Posts
16,335
Location
Plymouth
Well if you'd bothered to reply to those three threads with a thankyou I wouldn't have bothered with all this. I cba with pettyness but what I can be arsed with is manners young boy, manners :D

oh and atleast i dont come on ocuk only when i need help (not a dig at you but some people)
Aye, that's a good point. Those people suck :(
 
Permabanned
Joined
16 Dec 2002
Posts
10,237
ok i officially declare that in every thread i havent said THANK YOU! thank you, just because i dont write it doesnt mean i dont appreciate it! oh and thankyou in advance to EVERY problem you will all solve of mine in future ;)

i am glad we have sorted out this :)

PS> in future instead of taking it out indirectly, you should just deal with the matter directly ;)

PS> sorry for derailing the thread :o
 
Back
Top Bottom