Changing the frontpage RSS feed behavior in Drupal website

Of course we know that the contents of the RSS feed in front page will appear if we promote an article to the front page, and we can change some settings such as number of articles appearing in the RSS feed and other standard configurations.

But what if we only promote a single article on the frontpage? How to keep my latest articles in the RSS feed? Is there a way to overcome this without using modules such as Views?

We are experiencing the problems above a few days ago, but we do not want to use the module to overcome these limitations. And finally we decided to change the behavior of the frontpage RSS feeds with a little modification of Drupal core, we only change one number and the problem solved.

We changed the node module, and here are the steps that we do:

  1. First go to the modules -> node folder.
  2. Open the node.module file and find the following code, at about lines 1661:

    function node_feed($nids = FALSE, $channel = array()) {
      global $base_url, $language;

      if ($nids === FALSE) {
        $nids = array();
        $result = db_query_range(db_rewrite_sql('SELECT n.nid, n.created FROM {node} n WHERE n.promote = 1 AND n.status = 1 ORDER BY n.created DESC'), 0, variable_get('feed_default_items', 10));
        while ($row = db_fetch_object($result)) {
          $nids[] = $row->nid;
        }
      }


  3. Change the value from

    n WHERE n.promote = 1

    to

    n WHERE n.promote = 0

  4. Save the node.module file.

Above is how we change the Drupal frontpage RSS feed bahavior.

Danetsoft address

  • Office address: Perum Susukan Grabag, Magelang 56196 Indonesia.
  • e-Mail address: info@danetsoft.com

Visit other Danetsoft sites

Copyright © 2010 Danetsoft. All rights reserved.