Jump to content


Photo

getting the RSS Feed Module working

RSS Feed

  • Please log in to reply
2 replies to this topic

#1 Alex

Alex

    Full Member

  • Members
  • PipPipPip
  • 81 posts
  • 5

  • LocationMelbourne, Australia

Posted 02 March 2012 - 07:14 PM

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);


#2 ryan

ryan

    Hero Member

  • Administrators
  • 5,980 posts
  • 3383

  • LocationAtlanta, GA

Posted 02 March 2012 - 09:20 PM

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
}


#3 Alex

Alex

    Full Member

  • Members
  • PipPipPip
  • 81 posts
  • 5

  • LocationMelbourne, Australia

Posted 04 March 2012 - 08:38 PM

Thanks Ryan,
I have ended up putting it on a separate template, a bit simpler to set up now that I understand a bit more about it.





Also tagged with one or more of these keywords: RSS Feed

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users