How do I display a RSS Feed in a custom box?
Posted by Michael G.K on 30 August 2008 05:20 AM

Hey this is what I did to make rss work in templates simple.

Using this plugin
http://smarty.incutio.com/?page=RSSBlock

We've added the block.rss.php to /content/smarty_plugins.

Then we add these two lines below the comment in index.php
PHP Code:
// load additional smarty plugins & functions
        require_once("content/smarty_plugins/block.rss.php");
        $smarty->register_block("rss", "smarty_block_rss");

You have the rss plugin installed. You can now use it via the templates!

Code:

{rss file="http://www.php.net/news.rss" length="3"}
<a href="{$rss_item.link}" target=_blank> {$rss_item.title} </a><br>
{/rss}

(152 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).