Forum Moderators: open

Message Too Old, No Replies

Linking HTML to DIV?

Need some quick advice on how best to update my site news...

         

chevy409

7:55 pm on Nov 30, 2004 (gmt 0)

10+ Year Member



I made the mistake of making a site news box that is on all pages of my site and I'm looking for a way that I can update the news without having to edit each individual page. Right now the news is contained in a div... can I make a separate html file that I will update and link it somehow to the rest of the pages? Any help is much appreciated. Thanks in advance.

[edited by: chevy409 at 8:41 pm (utc) on Nov. 30, 2004]

benihana

8:27 pm on Nov 30, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



firstly, welcome to WebmasterWorld!

secondly, theres no need for the url - id edit the post or a mod will do it for you.

finally, there are a number of ways to do what you're after. if you have access to dreamweaver, frontpage, or possibly another wysiwyg editor, you can use a site wide find-and-replace.

altetrnatively,if you have access to a scripting language such as php, you can use an include file that will be bought into each page when it is requested by the browser. However, you would still have to update the pages the first time to change the news box code into an include code.

ideally, both options would be best - site wide find and replace to insert the include code the first time, then you can just update the one file in the future.

good luck!

chevy409

8:43 pm on Nov 30, 2004 (gmt 0)

10+ Year Member



Thank you for the fast reply.

I don't use dreamweaver or anything other than notepad. Could you please expand on the php idea? That sounds like what I want to do but I don't know where to begin. Do you know of a link that has an example of the include you are talking about? Again, thanks for the reply, and I'm open to any other ideas as well.

MatthewHSE

8:53 pm on Nov 30, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you don't know PHP, then Server Side Includes (SSI) are the way to go. More info here [perlscriptsjavascripts.com]. (Just read and follow everything up to the custom error pages section.)

chevy409

9:53 pm on Nov 30, 2004 (gmt 0)

10+ Year Member



I can't thank you enough, problem solved! Excellent, this is a great resources, glad I found it.

MatthewHSE

10:03 pm on Nov 30, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What did you end up using?

chevy409

10:57 pm on Nov 30, 2004 (gmt 0)

10+ Year Member



server side include, I just followed the link you gave me.