I know it's possible to add an RSS feed to a specific view by choosing it from the arguments area... but that gives you an RSS feed for that view only. Is it possible to use views to construct a primary RSS feed for the entire site without actually adding another block of content to the site?
The webcomic site I'm building uses the frontpage module and a number of different views to allow people to see the most recent content of each comic, as well as some bloggish stuff. The problem I'm having is that when the front page consists of nothing but view blocks, there is RSS feed. This makes perfect sense -- nothing is naturally promoted to the front page, so there's nothing for the feed to display.
Still, I want people to be able to subscribe to an RSS feed via the front page, and I was wondering if it would be possible to use views to build one. ideally I'd create a view that collected the ten most recently published items on the site and generated an RSS feed from those items -- but I wouldn't want anything displayed but the RSS feed itself (i.e., I wouldn't want the content collected by the display to show up on the site anywhere, I would simply want it used in order to create the RSS feed.)
Is it possible to do this?
Comments
To answer my own question...
Yes, it is possible to do this. I found it a little tricky, though. Here's what I did:
Create a new view (in my case, "webcomic_rss")
In the Page drop-down link
Check Provide Page View then give it a URL (I chose "rss"). The final URL will whatever you chose then "/feed" (i.e., "rss/feed"). Leaving the URL blank didn't work for me.
In the View Type field, select "Views RSS: RSS feed"
In the Nodes per Page field enter the number of items you want listed in your RSS feed (i.e. 5, 10, 15, however large you want it to be).
In the Block drop-down link
Check Provide Block (so that you can select it from your blocks menu).
In the View Type field, select "Views RSS: RSS feed"
In the Nodes per Page field enter the number of items you put in the similiar field for the Provide Page View area (I actually have no idea if this is necessary or not).
Leave the Fields drop-down link empty
Leaving this blank appears to create an RSS feed format based on your admin settings.
In the Arguments drop-down link
Use the Add Argument Drop-down list to add "RSS: RSS Feed Selector" and make sure Default is set to "Display All Values".
In the Filters drop-down link
Add whatever filters you want to use to restrict what content is included in the feed. For my part, I used filters to ensure that only my webcomic taxonomy terms were included, that only published nodes were included, and that only nodes created less than or equal to "now" were included (so that any comics I upload ahead of time will not show up in the feed until after they've been published)
In the Sort Criteria drop-down link
Use whatever sort criteria you wish. For my part, I chose to sort my RSS feed by created time "Descending" so that the newest items appear at the top of the feed.
Add the feed to your site
... now save your view. You'll see it in the blocks list, and can add the block wherever you want. It'll display where you specify it, and clicking on it will take you to the RSS feed.
This seems to work. I'm half afraid that if I sneeze wrong it'll all fall apart, but it seems to work...
RSS Taxonomy
Thanks for the walkthrough. Mine works fine.
I added a taxonomy vocabulary called RSS with one term RSS and set the filter to look for that term. Now anything I want to include in the feed (in the node types defined for the RSS vocabulary), I just set that vocabulary to RSS.
Great idea
Great idea setting up a specific RSS vocab for the feed. I tried that and then realised that since taxonomy creates its own feed for every vocab and term, using your way you don't have to use views at all.
The only problems with this way for me is that now I have to 1) stop the RSS term from being printed on all the relevant content nodes 2) update all the content that is already on my site with the RSS tag which is a pain to say the least, and I have an extra taxonomy term page with all the content on it that I'd rather not have (not really v important).
I wish there was some mega RSS module to handle all xml feeds.
Thanks a lot for that, very
Thanks a lot for that, very helpful! I've almost got it working but for some reason I'm getting duplicate content in the feeds even when I have the node distinct filter enabled. It seems that every time a new comment is added to a node the RSS feed picks up on it and includes the node content in the feed again (if only it included the actual new comment, it would be a feature!)
Does anyone have any idea how I can get rid of the duplicate content?
All you have to do is select
All you have to do is select Distinct in the filters section.
Trevor Twining
http://www.trevortwining.com
Trevor Twining
Freelance Drupal Dev
Theme/Modules/Sitebuilding
Subscribing, possible to do
Subscribing, possible to do this also for subcategories in hierarchy?
greetings,
Martijn
thanks
thanks a lot. finally after hours of search I got it work