{jr_feed_reader}
The {jr_feed_reader} template function is used for embedding external RSS Feeds directly into a Jamroom Template.
Parameters:
Name |
Type |
Required |
Default |
Description |
feed |
string |
yes |
n/a |
The "feed" parameter is the URL to the RSS Feed you want to pull in. |
template |
string |
yes |
n/a |
The "template" parameter defines the Jamroom skin template that wil be used to format the feed data. |
show |
integer |
no |
n/a |
If the "show" parameter is given, then only the number given will be "shown". For example, if the "default" number of articles in a feed is 10, you can enter a value of show="2" to limit the displayed feed articles to only the first 2 in the feed. |
cache_seconds |
integer |
no |
300 |
By default Jamroom will "cache" a feed for 300 seconds (5 minutes). You can change this cache length by passing in the "cache_seconds" parameter. |
assign |
string |
no |
no |
The "assign" parameter is an optional parameter that allows you to take the processed Feed output and store it in a template variable for further processing. This is handy to check to ensure the results of the fetch contain valid data. |
Example:
Example embedding the {jr_feed_reader} template function into a template:
{jr_feed_reader feed="http://slashdot.org/index.rss" template="slashdot_feed.tpl" cache_seconds="30"} |
The contents of the "slashdot_feed.tpl" template file:
{foreach from=$ITEMS item="_item"}
<h2><a href="{$_item.LINK}" target="_blank">{$_item.TITLE}</a></h2><br />
{$_item.DESCRIPTION}<br /><br />
{/foreach}
|
|
Note: The {jr_feed_reader} function first became available in Jamroom 3.0.29 |
|