Skip to content

ContentLEAD/bRss

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bRss

bRss is an rss feed parser based off of the jFeed plugin.

Options:

url: the url to the rss feed
wrapper: true/false
wrappername: if wrapper is set to true, add a name to the div that wraps around your feed items here
date: true/false
dateformat: if date is set to true, the dateformat can be set to one of these options

  • "fullmonths" - i.e. January 15 2015
  • "shortdate" - i.e. 1/15/15
image: true/false
category: true/false
catheader: if category is set to true, add the text you want to display before the cat name here
author: true/false
authorheader: if author is set to true, add the text you want to display before the author name here
description: true/false - displays the post excerpt
count: enter the number of feed items you want to display here
style: depending on the number of feed items, there are numerous inline style options:
  • "grid" - default style for three feed items
  • "zrss" - legacy style option for clients previously using the zrssFeed plugin
  • "grid4" - displays four items in one row
  • "grid4box" - displays two items in one row
  • "grid5" - displays three items in one row, two in a second row
  • "grid6" - displays thee items in one row, and three in a second row

Setting Everything Up

First include jQuery, then the bRss script.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script type="text/javascript" src="dist/bRss.min.js"></script>

Add this script to define the plugin options. Options that are not included will automatically default to false. This example calls 3 items from brafton.com's blog feed.

<script type="text/javascript">
	jQuery(function() {
		$("#result").BraftonRss({
		    		   url: 'http://brafton.com/blog/feed',
		           wrapper: true,
		       wrappername: 'brss',
		        dateformat: 'fullmonths',
		             image: true,
		              date: true,
		          category: true,
		         catheader: 'Posted in: ',
		            author: true,
		      authorheader: 'By: ',
		       description: true,
		             style: 'grid',
		             count: '3'
		    });
		});
</script>

Last, add the below code to call the feed items wherever you want them to display on the page:

<div id="result"></div>

Releases

No releases published

Packages

No packages published