ExpressionEngine Docs

RSS Parser

The RSS Parser plugin provides RSS parsing tags for your templates. It uses SimplePie to parse and render any RSS or Atom feed you throw at it.

Example

Here’s a simple example where we’re pulling the EllisLab blog feed and showing the five most recent posts:

{exp:rss_parser url="https://ellislab.com/blog/rss-feed" limit="5"}
<h1>{feed_title}</h1>
<ul>
    {feed_items}
        <li>
            <h2><a href="{item_link}">{item_title}</a></h2>
            <ul class="metadata">
                <li class="byline">by {item_authors backspace="2"}{author_name}, {/item_authors}</li>
                <li class="date">{item_date format="%F %d %Y"}</li>
            </ul>
            {item_content}
        </li>
    {/feed_items}
</ul>
{/exp:rss_parser}

Parameters

There are four available parameters:

url

The URL of the RSS or Atom feed

limit

Number of items to display from the feed

offset

Number of items to skip from the feed

refresh

How long you want the feed to be cached (default cache length is three hours)

Single Variables

Most of the variables are fairly self explanatory:

Both RSS 2.0 and Atom 1.0 feeds can have a “feed logo”. The following variables can be used to display the logo:

Also, if there’s an error in retrieving the feed, you can use the following variable to display the error:

Pair Variables

There are three pair variables available. Both {item_categories} and {item_authors}, are only available within {feed_items}.

{feed_items}

The {feed_items} variable contains all of the items found within the feed:

{item_authors}

The {item_authors} variable contains information about all of the authors of a particular item. Each author has three single variables associated with it:

{item_categories}

The {item_categories} variable contains all of the categories that a feed item has been assigned. Each category has one useful variable:

Conditionals

There are only two conditionals: