Changing the frontpage RSS feed behavior in Drupal website
Of course we know that the contents of the
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:
- First go to the modules -> node folder.
- 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;
}
} - Change the value from
n WHERE n.promote = 1to
n WHERE n.promote = 0 - Save the node.module file.
Above is how we change the Drupal frontpage RSS feed bahavior.