Trying extract image from XML.
Below is shown the source I get using views_rss+contemplate modules (still running drupal 5). I cant really put image into separated tag (it's not easy for non-coders),so I have it inside <description> tags.

<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://mydomain.com" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<item>
<title>My title here</title>
<link>http://mydomain.com/path_to_rss_source</link>
<description>Some text here

&lt;img src=&quot;http://mydomain.com/files/imagecache/product/folder/image.jpg&quot; alt=&quot;&quot; title=&quot;&quot;  class=&quot;imagecache imagecache-product&quot; /&gt;

</description>
</item>
</channel>
</rss>

When I create a feed,I see a lots of errors like:

warning: array_merge() [function.array-merge]: Argument #2 is not an array in /var/www/sole/data/www/mydomain.com/sites/all/modules/feeds/includes/FeedsConfigurable.inc on line 105.

Feed items display text as usually,but without images.

Question: how to show images in my feed?

Comments

alex_b’s picture

Status: Active » Closed (fixed)

The array_merge error you are reporting has been reported here: #625196: Fatal errors (Unsupported operand types) and warnings (Argument is not an array) in FeedsConfigurable

With the parsers that are coming with Feeds can't expose elements (img) that are contained by other elements (description).

You need to

- move the img element to an enclosure or similar element http://cyber.law.harvard.edu/rss/rss.html
- use simplepie parser and filefield / image field mappers #624088: Mapper: ImageField/FileField (formalize feed elements)

or

- include the img tag not-html encoded in the description and make sure that the img src is a full URL and available to the site that is aggregating.

volocuga’s picture

Ok,thanks for answer

The second method looks good for me. But if I use raw html,should I include it between CDATA tags?