We are using the Feed
Display for a view where we want to display all Articles
in a rss.xml
file. Below are the View settings. However, we cannot find a way to add an image attribute that meeting the RSS 2.0 specs.
How can we add an image to the RSS
feed display?
View settings:
- Format: Rss Feed
- Show: Fields | Settings
- Fields:
content: title
,content: body
,tracker: updated date
,content: link to content
,content: authored by
- Feed settings: path =
some/path/rss.xml
- Filter criteria:
published = yes
andContent type = Articles
When you click on settings in the Show
section, we assigned the fields.
- title field -> content: title
- link field -> content: link to content
- description field -> content: body
- creator field -> content: authored by
- publication date field -> tracker: updated date
What we tried:
- Include
field_image
underfields
and hide from display - Rewrite the output of the body to include the following
<enclosure url="{{field_image}}" length="100" type="image/jpg" />
- The
{{ field_image }}
is the available token after reordering field image underFields
section so that it is abovebody
field.
Results of what we tried:
<description>some body text **blank space where <enclosure> should display** </description>
Expected output (cannot get this result because <enclosure>
is stripped even when Strip HTML is false
):
<description>some body text</description>
<enclosure url="{{field_image}}" length="100" type="image/jpg" />