trinaryatom Posted June 14, 2011 Share Posted June 14, 2011 On the website I'm working on, i have a news feed. That news feed is on different pages with different looks (Different CSS styles). How do i get the news feed to store in a file and be loaded into every page desired. So that way, when i make a change to one, i don't have to copy paste over them all. Link to comment Share on other sites More sharing options...
Ingolme Posted June 14, 2011 Share Posted June 14, 2011 Where is your news stored? If you're actually updating the HTML file each time you update the news then you should be switching to a database system using a server-side language. Link to comment Share on other sites More sharing options...
trinaryatom Posted June 14, 2011 Author Share Posted June 14, 2011 Its HTML that looks something like this. <div id="Box"> <div id="boxtop"> <div id="Title"> Title <div id="date"> Date </div> </div> <div id="textbody"> Text blah blah blah Text blah blah blah Text blah blah blah Text blah blah blah </div> </div> <div id="boxmid"> <div id="Title"> Title <div id="date"> Date </div> </div> <div id="textbody"> Text blah blah blah Text blah blah blah Text blah blah blah Text blah blah blah </div> </div> <div id="boxmid"> <div id="Title"> Title <div id="date"> Date </div> </div> <div id="textbody"> Text blah blah blah Text blah blah blah Text blah blah blah Text blah blah blah </div> </div> <div id="boxmid"> <div id="Title"> Title <div id="date"> Date </div> </div> <div id="textbody"> Text blah blah blah Text blah blah blah Text blah blah blah Text blah blah blah </div> </div> <div id="boxmid"> <div id="Title"> Title <div id="date"> Date </div> </div> <div id="textbody"> Text blah blah blah Text blah blah blah Text blah blah blah Text blah blah blah </div> </div></div Right now I'm working on a JavaScript and XML setup. Link to comment Share on other sites More sharing options...
Ingolme Posted June 14, 2011 Share Posted June 14, 2011 You'll need a server-side language like PHP.Then you just need to use the include function: <?php include 'news.html'; ?> Link to comment Share on other sites More sharing options...
trinaryatom Posted June 14, 2011 Author Share Posted June 14, 2011 Wow that seems to easy.Its not like an iFrame where the width and height have to be predetermined?That's the reason why i don't use iFrames. Link to comment Share on other sites More sharing options...
thescientist Posted June 14, 2011 Share Posted June 14, 2011 no. it will literally include the code as if it were copy/pasted right into that part of the document. Link to comment Share on other sites More sharing options...
trinaryatom Posted June 14, 2011 Author Share Posted June 14, 2011 Very Awesome! Thank you all for the help once again. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.