RSS2HTML - extracting enclosure info from rss feed

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
stevegos

RSS2HTML - extracting enclosure info from rss feed

Post by stevegos »

Hi

I have a rss feed which contains an element called enclosure which contains a URL to an image:

<enclosure url="http://www.domain.co.uk/images/beer/thu ... c-5825.jpg" length="3800" type="image/gif"/>

I put the following in the template but it does not output the URL:

<img src="{$item.enclosure}">

Any ideas how to get this to work? All help greatly appreciated.

Steve
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: RSS2HTML - extracting enclosure info from rss feed

Post by Rolf »

Never used it, but in the img tag I see jpg *and* a gif call. Might be in conflict...

Rolf
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
stevegos

Re: RSS2HTML - extracting enclosure info from rss feed

Post by stevegos »

Thanks for that.

I did notice that but the same rss feed is being used by numerous other web sites who are able to display the jpg image fine and the guy that provides the feed says no one else is reporting any problems.

Steve
uniqu3

Re: RSS2HTML - extracting enclosure info from rss feed

Post by uniqu3 »

It doesn't output url as {$item.enclosure} is empty <enclosure/> has no value, what you need is target for enclusre attrubte called url where url is speficied.
Do {$item.enclosure|print_r} and see if array or object or anything that you can target is returned at all, so it would be array you could do {$item.enclosure.url} probably.
stevegos

Re: RSS2HTML - extracting enclosure info from rss feed

Post by stevegos »

Thanks uniqu3

{$item.enclosure|print_r} simply outputs the number 1 in every instance. Since my OP I have tried several variations {$item.enclosure.url} but it does not output anything.

Steve
stix
New Member
New Member
Posts: 9
Joined: Mon Jul 02, 2007 11:29 am

Re: RSS2HTML - extracting enclosure info from rss feed

Post by stix »

Hi there - I am having the same problem extracting an enclosure... Steve did you get anywhere with this in the end?
stevegos

Re: RSS2HTML - extracting enclosure info from rss feed

Post by stevegos »

Hi, No I gave up in the end as I just couldn't make it work.

Steve
alexis
Forum Members
Forum Members
Posts: 21
Joined: Wed Dec 29, 2010 3:31 am

Re: RSS2HTML - extracting enclosure info from rss feed

Post by alexis »

in my case i try {$item|print_r} and received the full array
then i see in array enclosure_url
case is closed ;D
Locked

Return to “Modules/Add-Ons”