CakePHP Automagic RSS Feeds (v1.2) Question/Comments

Example Feed

Notes

- If you're using CakePHP 1.2 then you're probably better off using the core RssHelper. It works a bit differently then this plugin, but gets the job done.

- Version 1.2 fixes compatibility with CakePHP 1.2.

- Version 1.1 fixes a naming issue with the base app controller and model.

ReadMe

  1. You'll need a working version of CakePHP installed. This is running on 1.2.6.
  2. Download FeedCreator 1.7.2-ppt and put the feedcreator.class.php file in /app/vendors/feedcreator.
  3. Download the plugin and unzip the contents to app/plugins. The plugin is called "rss", so make sure there is no conflict with any other controllers/plugins
  4. Add this to your /app/config/routes.php:
    $Route->connect('/rss/*', array('controller' => 'rss', 'action' => 'feed'));
  5. You have to allow permission for the plugin to generate a feed for a particular model. Edit your model to include:
    var $feed = true;
  6. The plugin will attempt to find default values for the feed.
    If your model includes a field 'title' or 'name' that will be used automatically for the item title.
    The fields 'desc', 'description', 'text', 'content' or 'body' will be used for the item description.
    The link will be '/{$model}/view/{$model->primaryKey}' by default.
    The results will be ordered by 'created' => 'DESC' by default.
    The limit is set to 10 by default.
    You can override any of these in the model, as well as set conditions for which rows are returned, by replacing the line used in step #5 with:
    $feed = array(
      'conditions' => array('Post.active' => true),
      'titleField' => 'Post.name',
      'descField' => 'Post.desc',
      'link' => '/post/view/%s',
      'orderby' => array('Post.created' => 'DESC'),
      'limit' => 10
    );
  7. You reach the feed using both the singular and plural model name (post or posts).

    http://yourapp/rss/modelname

    http://yourapp/rss/modelnames

(default) 1 query took 170 ms
NrQueryErrorAffectedNum. rowsTook (ms)
1DESCRIBE `js_validations`1111170