Hey, I’m lazy – I still run this blog on an ancient (in Internet time) version of the .Text blogging engine. In fact, I wanted to “upgrade” to Community Server (CS) at least twice, but the conversion process has not been as smooth as I’d want it to, plus the configuration is generally a nightmare if you have only a single blog and don’t want or need the rest of the CS features.
The other reason is that I’ve already integrated two “plug-ins” in the .Text that would most likely require some work to fit into the CS and here I am - still running 3 years old codebase. Having this in mind the .Text engine works surprisingly well…
Back to the point: if you’ve tried Internet Explorer 7, you have noticed that going to the RSS feed directly presents a nice HTML page rather than a plain XML view Internet Explorer 6 shows. The screenshot to the left shows my feed inside the Internet Explorer 7 beta 3. Note two things – you can sort entries by more than just a date and you can filter posts by the category. I have clicked on a Ruby category and got back 3 posts out of 10.
Filtering by category does not work by default with the .Text. The reason is trivial – for some reason even though the .Text supports categories they are not listed for each post in the main feed.
You can subscribe to a separate category or look at the posts only for a separate category, but the main feed will not contain them. It’s trivial to fix this though assuming you still have a copy of Visual Studio 2003 around – download the source code of the .Text project, and add the highlighted lines to Syndication\BaseRssWriter.cs in the Dottext.Framework project:
protected virtual void EntryXml(Entry entry, BlogConfigurationSettings settings, UrlFormats uformat)
{
this.WriteElementString("dc:creator",entry.Author);
//core
this.WriteElementString("title",entry.Title);
//core
this.WriteElementString("link",entry.Link);
this.WriteElementString("pubDate",entry.DateCreated.ToString("r"));
//core Should we set the
this.WriteElementString("guid",entry.Link);
// emit categories too
CategoryEntry ce = Dottext.Framework.Entries.GetCategoryEntry(entry.EntryID, true);
if(null != ce)
{
foreach(String category in ce.Categories)
WriteElementString("category", category);
}
// rest of the method...
}
Took me just a few minutes to find the right place and fix this because the code is very readable – well done Scott!
Be the first to rate this post
- Currently 0/5 Stars.
- 1
- 2
- 3
- 4
- 5