Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Typically, the channel link points to an HTML webpage, not the RSS url as seems to be hard-coded by the views_rss module.
It would be nice to allow the channel link to be customized to any desired path, via a text field on the views edit page.
It would also be useful if, by default, it pointed to the "page" view rather than the rss view (perhaps auto-generated by stripping off "/feed" from the end of the view path).
Comment | File | Size | Author |
---|---|---|---|
#3 | views_rss_channel_link.patch | 752 bytes | mfb |
Comments
Comment #1
scafmac CreditAttribution: scafmac commentedI would say this is a bug more than a feature request. At least the link to a feed instead of a link to the view page is a bug. Luckily, there is a simple fix. On or around line 102 of views_rss.module, change:
to:
The important part is that $view->real_url is changed to $view->url on the fourth line.
Also I do not agree that it is a good solution to add a field to point to any random page. Primarily because that is a bandaid for the problem. What other text fields will folks clamor for?
I'm just shooting from the hip here, but I believe the real problem is that there is no good way to override channel tags or add additional ones. A better solution might be to change the theme_views_rss_feed() function to call hook_nodeapi for the channel as well as each individual episode. This would allow a module to implement hook_nodeapi and overwrite the default tags, but more importantly to me, it allows to add any number of missing channel tags.
Any thoughts?
Comment #2
merlinofchaos CreditAttribution: merlinofchaos commentedscafmac:
Your general analysis is correct, but your actual solution fails if a view has other non-feed arguments.
The greatest example is the taxonomy view -- each taxonomy should have its own feed. That requires it to respect the taxonomy argument.
Right now, when placing the feed icon, Views constructs a version of the URL that has the 'feed' argument added. The fix for this basically requires doing the opposite; i.e, constructiong a version of the URL that has the 'feed' argument removed from the list.
This isn't that hard, but I have not had anything like free time for working on this in several weeks.
Comment #3
mfbHere's a simple patch for modifying the view URL as described.
Btw, my implementation had some "weird" requirements (syndication server); I ended up having to add a "channel link" field to the view edit page via form_alter.
Comment #4
merlinofchaos CreditAttribution: merlinofchaos commentedI fixed this the 'right' way; as well, I allowed the channel description to be set via the 'option' field of the argument. Twofer! Fixed in both 4.7 and 5
Comment #5
(not verified) CreditAttribution: commented