If you subscribe to a CodeBetter.Com blog with Bloglines, for example, you may have
noticed that weâve added an RSS 2.0
image tag to our feeds.

This involved just a few lines of code, all added to Community Serverâs
$\Components\Syndication\BaseRssWriter.cs class. Here's the step-by-step if you want to do it yourself.
Step 1: Add an AddImageElement Method.
Add this code somewhere in the BaseRssWriter class:
/// <summary>
/// ADDs the image element.
/// </summary>
/// <param
name="link">Link.</param>
/// <param
name="description">Description.</param>
protected void AddImageElement(string link, string
description)
{
// Image
Example
//<image>
// <title>Joel On
Software</title>
//
<url>http://www.joelonsoftware.com/RssJoelOnSoftware.jpg</url>
//
<link>http://www.joelonsoftware.com</link>
//
<width>144</width>
//
<height>25</height>
//
<description>Painless Software Management</description>
//</image>
this.WriteStartElement("image");
this.WriteElementString("title",Title);
this.WriteElementString("url", BaseUrl + "/RSS2Image.gif");
this.WriteElementString("link", FormatUrl(link));
this.WriteElementString("width", "144");
this.WriteElementString("height", "25");
this.WriteElementString("description", description);
this.WriteEndElement();
}
Step 2: Add Calling Code to the BuildChannel Method.
Add the bolded statement below after the âgeneratorâ element in the
BuildChannel method.
protected void BuildChannel(string link, string
description, string lang)
{
this.WriteElementString("title", Title);
this.WriteElementString("link", FormatUrl(link));
this.WriteElementString("description", description);
this.WriteElementString("dc:language", lang);
this.WriteElementString("generator", SiteStatistics.CommunityServerVersionVersionInfo);
this.AddImageElement(link,
description);
}
Step 3 Create your RSS Image:
Create a 144 x 25 pixel gif image, and place it in the root of your Community
Server Site.
Okay, if youâve looked at the code above and thought to
yourself, âWhat if my image is a different size?â or âWhat if I want a different
image for each blog?â or âWhat if I want to use a JPEG or PNG image instead?â
Well, then youâve got some code to write! For now, this was a
quick fix, and I only wanted to add one image to all feeds so I didnât make it
configurable. You should be able to add these as configuration properties, but
this will involve additional coding. If you only want one image for all feeds,
my code will work fine for you.
Thatâs it!
-Brendan
Read: Brand your CS Feeds with the RSS 2.0 image Tag