This post originated from an RSS feed registered with .NET Buzz
by Brendan Tompkins.
Original Post: Brand your CS Feeds with the RSS 2.0 image Tag
Feed Title: Brendan Tompkins
Feed URL: /error.htm?aspxerrorpath=/blogs/brendan.tompkins/Rss.aspx
Feed Description: Blog First. Ask Questions Later.
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:
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.