Sitemap - Contact Details

The latest top 5 hits from the DK - Webmaster Resource Directory

Add your webmaster resource to the DK - Webmaster Resource Directory today! FREE

Feed2JS: Style a Feed

Once you have built the code for your Feed2JS, you can see how the output of RSS content generated by Feed2JS can be customized by applying different style sheets. Each part of the feed has an identifier, allowing you to add styles to the box containing the feeds, the title, the item display, and the date posting text. A few sample styles are provided here; for more, see the Feed2JS Style Center.

Using a Style Sheet

You will need to incorporate the CSS code or linkage in your own HTML files; there are two ways you can do this:

  1. Insert the CSS directly into the HTML for the page that will display the feed. This methods is best for sites that only are displaying the feed on one or a few pages. Use the form below to find the style you desire, copy the CSS, and paste it somewhere into the <HEAD>...</HEAD> of your HTML file that contains the Feed2JS code, surrounded by the <style>...</style> tags shown below.
  2. <style type="text/css" media="all">

    <!-- this is where you paste the CSS provided by the form below -->

    </style>

  3. Link to an external style sheet. This method is best if you will be using the feeds on multiple pages, as the CSS is stored externally, and thus allows you to change the output display of many pages by editing a single file. Just copy the CSS provided by the form below, and paste it into a new text file. Save it as something called "myfeed.css". Think smart about where you decided to store this file, as other HTML pages that call it need to define a correct path to the file. Many web sites just create a top level directory named style and store all style sheet files in this directory.

    Regardless, to connect the HTML file that contains the Feed2JS code to an external style sheet, insert this line into the <HEAD>...</HEAD> of your HTML.
  4. <link rel="stylesheet" href="style/myfeed.css" media="all">

    <link rel="stylesheet" href="style/myfeed.css" media="all">

  5. Remember again that the value of href= must be a correct relative path (or a full valid URL such as http://www.blah.com/style/myfeed.css) from the HTML file to the CSS file.

CSS classes

This sketch represents the CSS classes created by Feed2JS.



Advanced: Two Styles in One Page

If you have more than one feed displayed per page, you can assign different styles to each display. You will need a solid understanding of CSS and inheritance to get this to work!.

By supplying a value for CSS Custom Class in the build form you can now create different top level classes. The value passed will create a CSS class named rss_box_XXXX where XXXX is this value. This implies that you may have to specifiy more specific classes for the other classes listed above, or use the top level rss_box_XXXX classes to say define a different background color.

See two exmaples:


Feed2JS

Feed2JS code is Copyright (C) 2004-2008 Alan Levine (Maricopa Community Colleges). It is available as both a free service and open source code from:
http://jade.mcli.dist.maricopa.edu/feed/

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details http://www.gnu.org/licenses/gpl.html


Web Design  |  Webmaster Tools  |  Webmaster Directory

© 2003 - 2008 DK Web Design