homeHome about meAbout Me contactContact Me portfolioPortfolio musicResume

XML Feed Plugin


Advertisement

Description

‘XML Feed’ is a Jquery plugin designed to allow you to post RSS feeds on your site. If you have multiple blogs this can make it easy to pull the feed from one and display it on your current page. Or use it to keep people up to date on your Twitter status (as I’ve done on Jeremy-Fry.com)

Recent Versions

Demo

The Twitter feed to the right is running using XML Feed but you can view all the example included in the archived files by going to this page. The graphics used in the examples are up for grabs and can be used as is on your own website

Setup

  1. Include the xml_reader.js file below your Jquery file.
  2. Open xml_reader.js and modifiy the phpFile option to point to
    the location of the xml.php file.
  3. Include the following:
    
    <script language="javascript">
    <!--
       $(document).ready(function(){
          $("#rss2").XmlFeed({
             itemWidth: 170,
             itemHeight: 90,
             navHeight: 8,
             maxItems: 5,
             stripTitle: 0,
             titleLen: 20,
             stripDesc:0,
             descLen: 85,
             displayTitle: true,
             displayDescription: true,
             displayPubDate: true,
             displayLink: true,
             titleAsLink: true,
             clickOnUl:true,
             prevImg: "arrow-left.png",
             nextImg: "arrow-right.png",
             feedURI: "http://feeds.feedburner.com/dezinerfolio?format=xml"
          });
    -->
    </script>
    

  4. There are a number of customizations that you can make:
    $(”#rss2″) - Replace #rss2 with the id of the div you want to use
    itemWidth - the width of the items
    itemHeight - the height of the items
    maxItems - how many items to display
    stripTitle - cut so many characters off the front of the title
    stripDesc - the same for the front of the description
    descLen - the length of description to display
    titleLen - same of the title
    displayTitle - whether or not to display the title field
    displayDescription - whether or not to display the description
    displayPubDate - whether or not to display the Publication date
    displayLink - whether or not to display the link
    titleAsLink - should the title be the link to the item (false displays it at the bottom)
    clickOnUl - if clicking on the item will scroll to next (can’t select text with this on)
    prveImg/nextImg - images for the prev next buttons
    feedURI - the http location of the feed you want to display
  5. Now that customization is done you can style the items. Everything is in a span with classes
    that are relevent: title, description, pubdate, prev, next, and so forth. Or you can use
    one of the examples.
  6. If you encounter any errors check to make sure everything is pointing to the right directory
    and that your allow_url_fopen = on.
  7. If you are still having trouble let me know at jeremy.m.fry@gmail.com

FAQ

Is it free?
Yes. XML Feed is free for personal use under the GNU GPL. If you find XML Feed to be helpful to you please consider donating.

Tags: , ,
Posted on Tuesday, October 14th, 2008. Category: Jquery Plugins, XML Feed


5 Responses to “XML Feed Plugin”