This project is read-only.

Add image element to rss feed

Mar 9, 2009 at 6:47 PM
I want to add a thumbnail (image) to the rss feed based on a file specified when a blog item is created. Is this easy to do?

Ideally, i would want the image link to be within an enclosure tag. Is this also possible? Is there any extensions that could help me?

Any hints in the right direction are greatly appreciated.


Mar 10, 2009 at 7:09 AM
You want the thumbnail image to appear in the RSS feed, but not in the normal post?

An extension could be created to maintain a separate list of RSS images.  For example, the extension could be designed so you enter the enclosure tag in the body of the post, and when saving the post, the extension extracts and removes that enclosure tag out of the post and saves the enclosure tag value in its own file.  Doing this has the benefit of not needing to modify the main BlogEngine core and existing files.

The only problem is that BlogEngine's RSS feed generator wouldn't know anything about this enclosure tag.  The RSS feed is generated in the BlogEngine core files.

So a better alternative might be to modify BlogEngine and add an "enclosure" property.  The enclosure value would be saved as just another property in the post XML file (saved in the App_Data\posts directory).  On the Add Entry tab, a new field would be created where you could type in the enclosure tag value.  Then the RSS feed generator could just add that enclosure tag value in the feed it produces.

Just some ideas ...