Yesterday’s Thoughts

June 13, 2005

Category-based RSS Feeds

It occurred to me that some of my readers might be interested only in politics, while others would be interested only in triathlon.

Following the instructions from the girlie matters I have added multiple RSS feeds to the site. The feeds are listed on this page. (Updated link.)

So far they aren’t auto discoverable.

I had to jump through some hoops to make it possible for MovableType to know what to call them. The were created automatically without any problem, I just created a Archive Template for each and there they were.

The issue was on the feeds page. I didn’t want to create the page by hand, so I created a template to generate them. There wasn’t a tag that held the name of the category as used on the file system for me to reference.

When the files are created, it is named like <MTCategoryArchive>.xml The problem is that is run through dirify before the file is written. So for instance, the Family Life category produces a file family_life.xml. If I tried to do that on my feeds page, <MTCategoryArchive>.xml is transformed into Family Life.xml.

I didn’t know how I could call dirify on MTCategoryArchive. &lt;$MTCategoryArchive$ dirify="1"&gt; doesn’t work.

Instead I created a new tag, MTCatgoryHandle. I registered a handle in MT::Template::Context, and in that handle I called dirify on MTCategoryLabel. I don’t know if this is the right way to go about this, I prefer not to be hacking in the source directly, but since I needed this once before, I decided to go for it.

Ideally I would like the index page of each category to contain both the name of the full site feeds and the specific category feeds.

Sorry, comments for this entry are closed at this time.