« The Link Awareness Network | Main | Flying While Brown »

A few changes

For a long time, I’ve wanted to have a sidebar where I could just put quick links to news and things of interest, while reserving the main body of the blog for original content or things I wished to excerpt or comment on. If only I could just dedicate one category to headlines, and have the main body select everything but that category, I thought.

Unfortunately, a shortcoming of Movable Type is that it doesn’t let you select categories exclusively — you can restrict with logical ANDs or ORs but not NOTs. I’ve continued to be surprised with each new release that it hasn’t been implemented.

It was almost a year ago Mena remarked on asking Ben about it :

Here’s my question: What are the technical limitations behind why we can’t have an exclude category in MTEntries?

Kevin Shay verifies there’s demand

One feature that seems to be requested fairly often on the MT support forums is the ability to specify categories by exclusion—NOT in addition to AND and OR—in the MTEntries tag. Well, this plugin doesn’t do that. Sorry. […] I don’t think there’s a good way to implement category exclusion without modifying the code of MTEntries itself.

There’ve been some previous implementations. David Rayne’s and Milbertus’ solutions are similar, but from reading the code I think they implicitly require all entries to have categories as entries without a category would be excluded if entries from any category were excluded. And I have a lot of category-less entries. There are some php approaches but as one implementer notes: “Might noticeably slow down your site, because there’s PHP for each entry” and I don’t have PHP installed anyway.

So taking Kevin’s word for it that I couldn’t look forward to a plugin any time soon, I just modified the code. And so now I have the headlines sidebar I always wanted.

I am a happy geek.

Comments

Is there any way that you could turn your code hack into a plugin for others to use?

No. I'm not even using it any more -- it broke when I upgraded my MT and I didn't fix it. My link sidebar is through the Other Blog plugin.

Maybe it'll be available in MT 3.0 (or maybe the support to make a plugin will be.)

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)