Welcome to WebmasterWorld Guest from 54.147.10.72

Forum Moderators: bill & werty

Message Too Old, No Replies

inserting images into an rss feed

     

wootang71

2:44 pm on Jul 25, 2005 (gmt 0)



i'm wondering how to insert images into an rss feed. i'm using dreamweaver to write an xml file, declaring rss version 2.0. so i have the text part down. but i've noticed some site's feeds contain images. an example is example.org, it's a blog site. in their rss feed, they've posted images. how did they do that? i'd like to know the xml code to allow me to publish images in an rss feed. any help would be awesome. thanks

[edited by: jatar_k at 5:19 pm (utc) on July 25, 2005]
[edit reason] sorry no urls thanks [/edit]

ScottM

12:54 pm on Aug 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



<image></image> is an optional sub-element of <channel> in RSS 2.0 and I believe you can use that.

It has 3 required sub-elements:

<url> (The URL of the image)
<title> (describes the image)
<link> (link of the SITE)

and 3 optional sub-elements:

<width> (default is 88-max 144)
<height> (default is 31 - max 400)
<description> (text for the title attribute of the link to the image)

So, you could structure your feed like this:

<image>
<url>http://www.yourwebsite.com/yourimage.jpg</url>
<title>Title of image</title>
<link>http://www.yourwebsite.com</link>
<width>50</width>
<height>150</height>
<description>This is my cool image for my feed</description>
</image>

Vespasian

7:32 pm on Aug 3, 2005 (gmt 0)

10+ Year Member



I can't make it work. I tested the .jpg URL and the link URL seperately, and they're fine. And I can use an <item> with text and the text shows up. But with <image> - nothing.

Here is the code I'm using. Can someone take a look and tell me what I'm doing wrong. I'm really green at this:

<?xml version="1.0" encoding="utf-8"?>

<rss version="2.0">

<channel>

<title>My Title Here</title>
<link>http://mysite.com</link>
<description>My description is here</description>
<language>en-us</language>

<image>
<url>http://mysite/1.jpg</url>
<title>Title of the photo</title>
<link>http://mysite.com/1.html</link>
</image>

</channel>

</rss>

ScottM

8:49 pm on Aug 3, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You got me? It should work.

A couple of things that may help:

In practice, the title and the link should be the same as the channel title and link. I also noticed in your sample code you are missing the .com in the <url>

Other than that, it should work.

Anyone else have any ideas?

 

Featured Threads

Hot Threads This Week

Hot Threads This Month