homepage Welcome to WebmasterWorld Guest from 54.166.84.82
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / RSS, ATOM, and Related Technologies
Forum Library, Charter, Moderators: bill & werty

RSS, ATOM, and Related Technologies Forum

    
inserting images into an rss feed
wootang71

10+ Year Member



 
Msg#: 314 posted 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

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 314 posted 12:54 pm on Aug 1, 2005 (gmt 0)

<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

10+ Year Member



 
Msg#: 314 posted 7:32 pm on Aug 3, 2005 (gmt 0)

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

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 314 posted 8:49 pm on Aug 3, 2005 (gmt 0)

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?

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / RSS, ATOM, and Related Technologies
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved