Jump to content

News Feed Distribution.


Recommended Posts

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 post
Share on other sites

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 post
Share on other sites

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 post
Share on other sites

You'll need a server-side language like PHP.Then you just need to use the include function:

<?php include 'news.html'; ?>

Link to post
Share on other sites

no. it will literally include the code as if it were copy/pasted right into that part of the document.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...