MT Category Mystery Resolved

So I'm talking with J$ via comments over the last few days, and he comes up with quite an interesting query:
On another MT note, have you looked at the DB structure. (Atrocious, I know.) Do you know where the fuck it stores category_id's for entries?
So, I did some digging, and the categories are in the mt_placement table, the fields are pretty self-explanatory once you realize what you're seeing. I haven't really decided if the way they're storing it is good or bad, but it certianly works.
More Below.

As J$ pointed also out: there should be a 'jnEntryCategory' table. (There's not, by the way. Apparently, some developers think that that database normalization stuff is just bullshit theory.)
It's all in there, it's just not immediately recognizable as your standard jnTable, since it includes the blog ID (why? Categories are blog-specific, I think) and a flag for is_primary, since everything must have at exactly one primary category.

Another thing that has been vexing J$ greatly and I've been struggling with myself is the category mangling and the godforsaken excluded feature of category exclusion in the tag. So J$'s using some crazy MTCategoryFilter pluging that seems to work with some caveats, I'm trying to go with something a little more elementary and perhaps naive:

Every entry has a primary category of "blog", which is the coincedentally the categoy I use to restrict entries on the main index page. I then create a category index page similar to this one in //index.php, each one restricted to the parent category. Now, 99% of the posts just go into the 'blog' category where I say things like greatest...website...ever. Once in a great while, I'll put up somerambling diatribe about the draconian nature of current technology legislation that should be in the "The Man is Out to Get You" category, so I make it's primary category "blog", and the seconday category "The Man is Out to Get You". Now it shows up on my main page, and also in the index page for that category (conveniently linked in the sidebar).

Is this a "kludgy"? Yeah, a little. Is it better than enumerating every category except "one-liner" in every template? A little, but barely. I know there are going to be some glitches (the indevidual archive previous<--->next links, for example), but I think it'll work out. It seems to me that you can accomplish what J$'s going for (everything on the main index except category 'X'), and still be able to generate meaningful category listings as well. Comments, J$?

Categories

0 TrackBacks

Listed below are links to weblogs that reference this post: MT Category Mystery Resolved.

TrackBack URL for this entry: http://andywismar.com/cgi-bin/mt-tb.cgi/51

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.)