Jump to content

getting the RSS Feed Module working


Alex
 Share

Recommended Posts

I'm looking at getting an RSS feed on my blog page, i'm unsure how to incorporate the example code provided from the RSS Feed Module forum post into my template.

Is it mean't to go on my blog page template or exist as a separate template?

<?php
// retrieve the RSS module
$rss = $modules->get("MarkupRSS");
// configure the feed. see the actual module file for more optional config options.
$rss->title = "Latest updates";
$rss->description = "The most recent pages updated on my site";
// find the pages you want to appear in the feed.
// this can be any group of pages returned by $pages->find() or $page->children(), etc.
$items = $pages->find("limit=10, sort=-modified");
// send the output of the RSS feed, and you are done
$rss->render($items);
Link to comment
Share on other sites

You can put it in a separate template or keep it in the same one. If you keep it in the same one, then you'll want to trigger the RSS feed from a URL segment or a get variable, i.e.

if($input->urlSegment1 == 'rss') {
   $rss = $modules->get('MarkupRSS'); 
   // rss output
} else {
   // non-rss output
}

// or

if($input->get->rss) {
   // rss output 
} else {
   // non-rss output
}
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...