Guys,
bear with me on this one please, as this is simething I need to understand but don't know where to start.
I install a default Drupal site, I create content and promote and voila I have an RSS icon at the bottom of the front page allowing a someone to subscribe to the feed.
Alternatively I create new content types and implement Views to display said content and again voila I have optionally an icon at the bottom of the list (or whatever) which allows someone to subscribe to that subset of my sites data.
However I do neither of these things. Whilst Views is fantastic as a long time SQL programmer I implment the selection and display myself usually using pager_query.
I can obviously insert a small icon at the end of this list to to allow an RSS feed but what does it actually point to in my site. do I then have to go create an XML page or what ? - Told you I was new to this.
What is the best way to add an RSS feed to any content type I produce, again I really have no wish to use Views, besides too much of my site would require changing to implement this.
I did post this in the general forum but alas got no reply, any pointers here to get me started would be appreciated.
Is this the best place to start...
http://api.drupal.org/api/function/node_feed/5
Thanks
Keith
Comments
Not an expert but...
I think if you view the source for the RSS page to which the icon points (or RSS for any other site) you should see that it's a pretty straightforward XML structure – I think it's the CSS which makes it look like an HTML page.
So if you can convert your pager_query output to the appropriate XML format, that should be all you need.
...still think it's easier to use Views though...
drupal_add_feed
Run your nodes through node_feed for some callback path (e.g. yourmodule/feed). To add that URL to a page, use drupal_add_feed:
http://api.drupal.org/api/function/drupal_add_feed/5
I'm unencumbered by knowledge here, I just typed "feed" into api.drupal.org and looked at the functions.
Cheers
THanks guys, appreciate your help here.
I'll look into this towards teh end of the week, a little busy beforehand. As the data I want to RSS is from my own tables, the page constructed at 'runtime' via PHP, and not Drupal nodes do you think this will be an issue ?
I was verging on the just construct XML route which should be pretty simple as after all thats all that Views is doing. I just don't see the need for Views though if I can program the pages myself, I get total flexibility that way.
Thanks
Keith