Option to disable feeds in header and implement block with links to comment rss feeds
teradome - September 17, 2007 - 16:27
| Project: | Comment RSS |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs work |
Description
hey there.
so the links for comment rss feeds are listed first in the $head of the pages they are inserted into
for most bots, the first link is assumed to be the content feed for that page, so when users add a site to an rss service (e.g., AideRSS) the comments feed becomes the main, indexed feed for that site.
comment rss feeds should be listed after the drupal content rss link

#1
I got hit by this in with Technorati picking up my comments instead of my posts on my site. I'll see if I can poke around over the weekend and create a quick patch.
#2
I figured that this would be pretty complex to fix. It's my first time really looking at Drupal's code, so I'm pretty much learning how it works at the same time.
For now, this is what I've discovered while stepping through the code:
It looks like the function to call to setup rss feeds is drupal_add_feed() in includes/common.inc. This function itself calls drupal_add_link(), which then finally calls drupal_set_html_head() (both in the same file) to insert the rss links into the a static variable that will eventually used as the header.
The main front-page RSS feed is inserted into the header in the function node_page_default() in the file modules/node/node.module.
The commentrss feeds are inserted into the header in the function commentrss_menu() in commentrss.module.
The unfortunate thing is that commentrss_menu() is called before node_page_default(), causing the comment rss feeds to be inserted before the main feed, causing the comments to be autodetected first.
There's no way that I can see where modifying the theme will be able to fix this.
I currently see two possible plans of action:
Hopefully, I will be able to develop a solution as I study the code, but feel free to add suggestions if you think of any.
#3
I had just thought of a third probably even better solution than the other two: Give an option to disable the comment rss links in the header, but provide a block with the links. I'll try to get to making a patch for this over the weekend, as I get some time.
#4
The patch adds a new option under admin/content/commentrss which lets the admin choose whether to have the links to the feeds be added to the header or not. It also implements a block that will contain the links to the RSS feeds.
Turning off the add feeds to header option and placing the available block some where will get around the issue of the comment feeds coming before the front page RSS feeds, while still providing the comment rss feeds in the block.
#5
Could this be fixed with the module weight module, setting Comment RSS to have a lower weight than Node?
If that doesn't work, I'd say this is a good thing to submit as a feature fix to core. It potentially affects every module that tries to add a feed.
#6
FYI, no, a weight change (higher or lower than node) to Comment RSS does NOT fix this.
#7
Marked #356031: crss feed included too early in <head> as a duplicate of this issue. Needs to have some more work done for 6.x-2.x first.