Closed (fixed)
Project:
Feeds
Version:
6.x-1.0-alpha8
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
7 Dec 2009 at 13:24 UTC
Updated:
7 Dec 2009 at 21:38 UTC
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
<img src="http://mydomain.com/files/imagecache/product/folder/image.jpg" alt="" title="" class="imagecache imagecache-product" />
</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
Comment #1
alex_b commentedThe 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.
Comment #2
volocuga commentedOk,thanks for answer
The second method looks good for me. But if I use raw html,should I include it between CDATA tags?