Community Documentation

Setting up core <item> elements

Last updated November 2, 2012. Created by maciej.zgadzaj on November 19, 2011.
Edited by jcisio, HongPong, nicoz. Log in to edit this page.

This guide applies mainly to 2.x branches of Views RSS module, although some of the features described here were implemented in the most recent versions of 1.x-dev branches as well.

To have all the fields described below available, first you need to enable Views RSS: Core Elements submodule (included in main Views RSS package).

<title>

Use field Node: Title.

In field configuration section:

  • uncheck Link this field to its node
  • check Strip HTML tags

More information: RSS Specification and RSS Best Practices.

<link>

Use field Node: Path or Content: Path in D7.

In field configuration section:

  • check Use absolute link (begins with "http://")

More information: RSS Specification and RSS Best Practices.

<description>

Use whichever field you want (any of textfields/textareas, for example Node: Body or Node: Teaser in D6).

HTML is allowed in this element, and will be properly encoded by the module.

More information: RSS Specification and RSS Best Practices.

<author>

For D7, first add Content: Author relationship.

Use field User: E-mail.

In field configuration section:

  • in Link this field select No link
  • optionally, you can change Format to RSS email: with user name to get emails together with user names - like geo@herald.com (George Matesky) - instead of just email address

More information: RSS Specification and RSS Best Practices.

<category>

Use (for example) Taxonomy: All terms field.

In field configuration section:

  • in Display type select RSS &lt;category&gt; element
  • that's all

Note that this is different from the channel category element.

More information: RSS Specification and RSS Best Practices.

<comments>

Use field Node: Path or Content: Path in D7 (add another one, do not use the same one which you used for <link> element).

In field configuration section:

  • change Label to Comments Path (to be able to easily distinguish it later from first Path field)
  • check Use absolute link (begins with "http://")
  • check Rewrite the output of this field and modify provided URL to your needs - for example entering something like [path_1]#comments

More information: RSS Specification and RSS Best Practices.

<enclosure>

In D6, use File field provided by FileField module (either File Upload or Image). Files added to nodes through core Upload module are not supported and will not be rendered correctly.

In D7, use standard Image, a File field, or a Link or Text field containing a URL with the media item.

Select RSS <enclosure> element as field formatter.

Based on RSS 2.0 specification one <item> cannot have more than one <enclosure> element. Therefore if you have more than one file added to your File field in any of the nodes passed to the view, in the field configuration section you have to check Group multiple values and Show only 1 value. If you do not group, multiple <enclosure> items will be created for such node - as many as number of files attached to the node.

Also, in case of D6, if you enter more than 1 into Show value(s) field (or do not enter anything), theme function will add extra HTML which will break the feed.

More information: RSS Specification and RSS Best Practices.

<guid>

Use whatever value you want, just make sure that it will uniquely identify the feed item (node).

Most usually feeds use the same value for <path> and for <guid> elements.

isPermaLink attribute is automatically added to this element, with its value set to:

  • false - if value for <link> element was provided,
  • true - if no value for <link> element was provided and <guid> value is a valid URL.

More information: RSS Specification and RSS Best Practices.

<pubDate>

Use field Node: Post date.

In field configuration section:

  • in Date format select Custom
  • in Custom date format enter r for RFC 2822 formatted date

More information: RSS Specification and RSS Best Practices.

<source>

Generated automatically by the module.

More information: RSS Specification and RSS Best Practices.

About this page

Drupal version
Drupal 6.x, Drupal 7.x
Level
Beginner
Audience
Site administrators
Drupal’s online documentation is © 2000-2013 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License. Comments on documentation pages are used to improve content and then deleted.
nobody click here