Alex Posted March 3, 2012 Share Posted March 3, 2012 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 More sharing options...
ryan Posted March 3, 2012 Share Posted March 3, 2012 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 More sharing options...
Alex Posted March 5, 2012 Author Share Posted March 5, 2012 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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now