1

I'm wondering if there's a way to make a view render an Atom feed with custom fields, that would output something similar to this:

<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" ... xml:lang="en-US">
   <title type="text">my atom feed</title>
   <subtitle type="text">my atom feed subtitle</subtitle>
   <id>the feed's url</id>
   <rights type="text">some copyright</rights>
   <updated>2013-06-14T02:29:00Z</updated>
   <author>
      <name>me</name>
   </author>
   <generator>my feed generator</generator>
   <link rel="alternate" type="text/html" href="my site's url" />
   <link rel="self" href="the feed's url" />
   <my:field1>value1</my:field1>
   <entry type="my_type_1">
      <id>an article's url</id>
      <title type="html">article title</title>
      <summary type="html">article summary</summary>
      <published>2013-06-14T01:16:00Z</published>
      <updated>2013-06-14T01:47:40Z</updated>
      <author>
         <name>someone</name>
         <uri>the guy's bio page url</uri>
      </author>
      <content type="html">full body content in &lt;strong&gt;html&lt;/strong&gt;</content>
      <my:numeric_field>2</my:numeric_field>
      <my:yet_another_custom_field>hi there</my:yet_another_custom_field>
   </entry>
   <entry> ... </entry>
</feed>

The views_rss module can do stuff like this (in fact, I've already accomplished a lot using its hooks to define the fields, and field formatters to do stuff like <author><name>name taken from a user reference field in the node</name><uri>the user's url</uri></author>, but I can't find a similar module that provides the same functionality for Atom feeds.

Is there such a module out there? I've tried atom and views_atom without success. If not, how hard would it be to implement it? I guess this would involve making a "views plugin", with which I'm not really familiar.

1

You don't need a module to do that. You can use .tpl files to wrap rows in <entry> tags, fields in their tags and so on. It may be a bit less intuitive and more exhausting at first, but in the long run you will get exactly what you ask for, without compromises modules call for.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.