The link element should be a URL so e.g. http://www.test.nl/ and not a domain. And the link of the image element should usually the same as the link of the channel element.
Other than that, you need to precisely tell us what "wouldn't work"? Have you tried a feed validator and get errors? Which exactly?
Martin Honnen --- MVP Data Platform Development
My blog
Yes, I figure that out later.....my bad. I didn't had my feed online so I couldn't check it by feedvalidator.org. But now it's online and I solve the problems. It's nou an valid rss feed. The only thing is that when I check it out in Firefox I see my image....but
not in Internet Explorer. Someone know what this could be??
But I don't think this is the problem that I can't see my image in IE, only FF. Someone know howto add that href link? And the solution for not seeing my image?
Yeah lol, I just find out that the image I'm try to see only for the channel is with the image tag.....What I want is to add an image to each feed item. Someone know howto do this?
Noone knows how to add an image to each feed item?? Cuz I checked everywhere on the internet en the only thing I found is what I have now. And that is an image for the channel....... When I try this for the Item it's not an valid rss feed anymore and I don't
see the images....
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question.
Yeah I already got the solution and it was quite easy. What you have to do when you have to want images in each feed item, you use html tags in the description. My writeItemfuntion checks of the url of the image is not emty and then of the image hyperlink
is not emty (for a clickable image), if so then he write the <img> html tag only and if he's not emty he write the <href> tag & <img> tag. My function looks like this:
Pitex
Member
6 Points
12 Posts
Image in RSS feed
Feb 16, 2009 02:20 PM|LINK
Hello there,
I'm trying to insert a image in my rss feed but it wouldn't work.....this is my xml code:
Martin_Honne...
Star
14481 Points
2006 Posts
MVP
Re: Image in RSS feed
Feb 16, 2009 03:20 PM|LINK
The link element should be a URL so e.g. http://www.test.nl/ and not a domain. And the link of the image element should usually the same as the link of the channel element.
Other than that, you need to precisely tell us what "wouldn't work"? Have you tried a feed validator and get errors? Which exactly?
My blog
Pitex
Member
6 Points
12 Posts
Re: Image in RSS feed
Feb 17, 2009 11:27 AM|LINK
Yes, I figure that out later.....my bad. I didn't had my feed online so I couldn't check it by feedvalidator.org. But now it's online and I solve the problems. It's nou an valid rss feed. The only thing is that when I check it out in Firefox I see my image....but not in Internet Explorer. Someone know what this could be??
This is my xml code:
The only recommendation feedvalidator.org said, is that I am mBut I don't think this is the problem that I can't see my image in IE, only FF. Someone know howto add that href link? And the solution for not seeing my image?
Thx
Pitex
Member
6 Points
12 Posts
Re: Image in RSS feed
Feb 17, 2009 12:10 PM|LINK
Yeah lol, I just find out that the image I'm try to see only for the channel is with the image tag.....What I want is to add an image to each feed item. Someone know howto do this?
Pitex
Member
6 Points
12 Posts
Re: Image in RSS feed
Feb 17, 2009 06:17 PM|LINK
Noone knows how to add an image to each feed item?? Cuz I checked everywhere on the internet en the only thing I found is what I have now. And that is an image for the channel....... When I try this for the Item it's not an valid rss feed anymore and I don't see the images....
?? Thx..
Samu Zhang -...
All-Star
62163 Points
6101 Posts
Re: Image in RSS feed
Feb 18, 2009 07:25 AM|LINK
Hi Pitex ,
You may try to apply xslt file on this xml file.
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:atom="http://www.w3.org/2005/Atom"> <xsl:output method="xml" /> <xsl:template match="/"> <html> <body> <xsl:apply-templates select="//image"></xsl:apply-templates> </body> </html> </xsl:template> <xsl:template match="//image"> <img > <xsl:attribute name="src"> <xsl:value-of select="url"></xsl:value-of> </xsl:attribute> </img> </xsl:template> </xsl:stylesheet>XML file :
Samu Zhang
Microsoft Online Community Support
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question.
Pitex
Member
6 Points
12 Posts
Re: Image in RSS feed
Feb 19, 2009 10:02 AM|LINK
Yeah I already got the solution and it was quite easy. What you have to do when you have to want images in each feed item, you use html tags in the description. My writeItemfuntion checks of the url of the image is not emty and then of the image hyperlink is not emty (for a clickable image), if so then he write the <img> html tag only and if he's not emty he write the <href> tag & <img> tag. My function looks like this:
private void WriteItem(XmlTextWriter xwRss, FeedItem f) { try { if (f.ImgURL != null || f.ImgURL == "") { if (f.ImgHyperLink == null || f.ImgHyperLink == "") { f.Description = "<img src='" + f.ImgURL + "' style='float: left' alt=''/>" + f.Description; } else { f.Description = "<a href=" + f.ImgHyperLink + "> <img src='" + f.ImgURL + "' style='float: left' alt=''> </a>" + f.Description; } } xwRss.WriteStartElement("item"); xwRss.WriteElementString("title", f.Title); xwRss.WriteElementString("description", f.Description); xwRss.WriteElementString("link", f.URL); xwRss.WriteElementString("guid", f.Guid); if (f.pubDate.HasValue) xwRss.WriteElementString("pubDate", f.pubDate.Value.ToString("ddd, dd MMM yyyy HH':'mm':'ss 'GMT'", culture)); xwRss.WriteElementString("author", f.Author); xwRss.WriteEndElement(); } catch { throw; } }This works fine !
Pitex
Member
6 Points
12 Posts
Re: Image in RSS feed
Feb 19, 2009 11:03 AM|LINK
I just solve my last problem: Adding this line: