LemonStand Documentation

Implementing RSS channels

The blog module allows you to add two RSS channels to your website - the posts RSS channel and the comments RSS channel. The both channels should be implemented as regular CMS pages.

Creating the posts RSS channel

Create a new page and assign it some name and URL, for example /rss. Paste the following code to the Content field. No other HTML or PHP content is allowed.

<?=
  Blog_Post::get_rss(
    "My blog",
    "My news and updates",
    site_url('rss'),
    site_url('blog/post'),
    site_url('blog/category'),
    site_url('blog'),
    20);
?>

The first and second parameters specify the RSS feed name and description.

In the parameters 3-6 you should specify URLs of the RSS channel page (this page), blog post page, blog category page and the blog root page (or archive page). The site_url() function outputs an absolute page URL, including the protocol.

The last parameters specifies how many blog posts to return in the RSS feed.

Creating the comments RSS channel

Create a new page and assign it some name and URL, for example /comments_rss. Paste the following code to the Content field. No other HTML or PHP content is allowed.

<?=
  Blog_Post::get_comments_rss(
    "My blog comments",
    "Comments posted by the website visitors",
    site_url('comments_rss'),
    site_url('blog/post'),
    site_url('blog/category'),
    site_url('blog'),
    20);
?>

The parameters of the Blog_Post::get_comments_rss() method are similar to the parameters of the Blog_Post::get_rss() method described above.

Next: Configuring the new comment notifications
Previous: Adding the comment form
Return to Blog module

Comments

No comments posted so far.

Add your comment

Loading form...