Hi all -
Forgive what may be a foolish question. Views 2 is so powerful that, when I needed a custom XML feed of certain chunks of my data, I thought I could use a View display and create my own template for it which would output my custom XML, rather than HTML.
Ideally, I guess I would create my own feed type by copying and modifying the RSS one, but that seems a bit complex for a one-off special, unless there's a tidy way to do this?
So I'm trying to do a custom template for RSS using views-view-rss--Myview.tpl.php, because this lets me get around the page-level formatting, but I'm not quite sure whether this is sensible - it gets passed all sorts of things that I don't need and I think I may be going about this the wrong way.
Basically, when a particular view, or particular display of a view, is requested as a page, I would like to be able to return certain fields of the nodes as XML without all the surrounding standard page templating. Is this possible?
Any help very much appreciated!
Comments
Comment #1
merlinofchaos commentedViews Bonus Pack and views datasource modules both contain styles to do XML.
Comment #2
quentinsf commentedMany thanks -
Views Bonus Pack doesn't work under 6.x, and I had seen Views Datasource but hadn't been able to get it working. I noticed there were several other people who were also failing to get it to work under recent Views, though - http://drupal.org/node/307223 - so I didn't pursue it.
However, more recent posts suggest that others have managed to get it to work, though I haven't had any luck yet...
http://drupal.org/node/318864
Will keep trying - but hence my question as to whether there might be a simpler way :-)
Many thanks,
Quentin
Comment #3
dwees commentedQuentin see:
http://drupal.org/node/307223#comment-1040887
I've used the code from this comment and it seems to work. What is especially nice is that it looks like it is relatively easy to define your own template if you examine the code.
Comment #4
merlinofchaos commentedIn any case, Views itself will not support these as modules can do it quite nicely.