Integrating News Feeds (cont'd)

The View
The view component for the application is a Web page. As part of the View, I'll use CSS to handle the data formatting and HTML as a structured data container Open your favorite text editor and create the stylesheet:

   .WebFeed {
      font:8pt Verdana,sans-serif;
      color: navy;
      width:150;
      padding: 5px;
      margin: 5px;
   }
   .content {
      position:absolute;
      top:15;
      left: 180;
      color:navy;
      font-family: Verdana,sans-serif;
      z-index: 2;
   }
Save the file as newsfeed.css in a clean directory.

The Controller layer generates most of the HTML dynamically, but you still need to create an HTML shell for the application to fill with data. Create the file newsfeed.htm by entering the following code:

   <html>
   <head>
   <title>Newsfeed Demo</title>
   <link rel="stylesheet" type="text/css" href="newsfeed.css" />
   </head>
   <body>
   </body>
   </html>
Save the newsfeed.htm file in the same directory as newsfeed.css.




Previous: The Model
 
Next: The Controller


Introduction Where Are The News Feeds? The Model
The View The Controller Putting It All Together


Return to Get Help with dhtml Page

Return to Main Get Help Page
 





Problem: Users like news feeds, and they can increase traffic to your site, but the real trick is to implement them and avoid creating a maintenance nightmare. How can you implement a newsfeed generically, with reusable code?




Solution: Use the Model-View-Controller (MVC) architecture to minimizes the changes required to switch news feeds. This solution shows you how to switch news feeds by changing just a few lines of code.



Find Out More
Get the Code

Microsoft Windows Script Technologies

Essential JavaScript

Live Sample: Test the Newsfeed from Moreover.com

Moreover.com

Backwash.com

Magportal.com

TALK BACK
Do you use a newsfeed service now? Did you think you had to create complicated script or use controls to implement newsfeeds in your site? Do you like this article's approach to implementing a newsfeed? Join the discussions at Web.dhtml.general and Web.dhtml.scripting to get answers, make comments, or help others with their problems.
Talk Now


Sponsored Links