Hi,

I just installed commentrss on my site and realized that the comment RSS feed is above the "normal" RSS feed in the header of my site. This is bad, because when people click on the nice and shiny rss icon in the address bar of their browsers, they subscribe to the commentrss feed and not the content feed. Is there a way to change this behaviour?

Thanks in advance,

Markus

Comments

gábor hojtsy’s picture

Since module hooks are called in module weight orded (or of no module weight specified, in alphabetical order), you can circumvent this behaviour. Now the commentrss module code is called before the node or taxonomy module code, because your modules are called in alphabetical order. If you assign a larger weight number to the commentrss module (in the system database table weight column), then this module will be called later. Look if you have weights for node and taxonomy and give a bigger weight for commentrss.

Maybe this can be made a patch, so that the module checks weights in install time, and sets a larger enough weight for itself. This however does not guarantee that later the node and/or taxonomy modules will not change their weights, or an admin will not change their weight, and it is not possible to cleanly monitor that.

filiptc’s picture

Changing weights did not help with me (Drupal 5 RC1). Other ideas?
Phil

gábor hojtsy’s picture

Status: Active » Closed (works as designed)

Ah, I checked the source, and module weight really does not help here. The problem is that the drupal_add_feed() is in the page callback function. Unfortunately there is no callback called after the page callback function and before the page theme function (we would only be able to add the feed to the proper last place at that time), so I don't see a possibility to add this feed to the end.

What you can do is to implement your theme, so it reorders the feeds it gets from drupal_get_feed() - or better, a direct call from drupal_add_feed() without parameters, so you don't need to split a string.

Unless it can be made possible to have a hook between the page callback function and the page theme function call (implemented as menu_execute_active_handler() and print theme('page', $return) in index.php), there is no other possibility as far as I see.

afreytes’s picture

This is also a problem with Technorati, it seems to get the first feed available and gets the comments instead of the posts.

If someone has done Hojtsy's theme workaround, could you post the relevant code here for those of us less knowledgable? TIA