February 15, 2004

RSS 2.0 Feed for MT

I started my photography blog here last week. MT has the ability to automatically generate an RSS feed. My friend Jason mentioned that the feed only sent the title and description, but not the images.

Here is a cheat to let you send images from a Photoblog in an RSS feed. It is not RSS valid, but it works. My particular Photoblog feed is a hack intself of MT. Detailed information on how the blog was done can be found at Quixotic Pixels-QP

QP has you take the URL and concatenate it from the Entry Body frame and put it into the Extended Entry frame. ie. img src="http://www.rivinus.com/test.jpg" would be shortened to just http://www.rivinus.com/test. The HTML main entry archive adds the ".jpg" when it forms the pages. Your entry body is actually used as the description of the photograph.

To get the images to show up in an RSS feed, you simply take the original URL and put it in the Except frame. In the above example you would place img src='http://www.rivinus.com/test.jpg" in the Excerpt frame. You need to add < before IMG and > after the last parentheses " I took them out because MT was converting them to links

Now go to your TEMPLATES page. You want to edit the RSS 2.0 Feed . You should have something that looks like this:

description><$MTEntryExcerpt remove_html="1" encode_xml="1"$> /description

Replace this with this:

source> <$MTEntryExcerpt encode_xml="1"$>/source

description><$MTEntryBody encode_xml="1"$>/description

Note: Again I had to remove the forward and ending bracks <> for MT to be able to do this article

Source will display in your RSS feed at an image hyperlink and the desciption will display above the image

You can download the text file I used at the RSS file here Right click and "save as" to your computer.

I know this is cheating and the source should be a URL. This is the best I could figure out how to make this work. I'll take other suggestions.

You can subscribe to my Photoblog feed here

Posted by srivinus at February 15, 2004 04:17 PM
Comments