January 22, 2004

Individual archive navigation by category

I was looking for a by-category navigation option to use within the individual archives for a sectioned photo gallery for a client. I tried out several options, but settled on the simplest one -- you just install two plugins then pop a bit of code in your individual archive template.

The first post (by jlamos) has a script that almost works, except for a minor tweak suggested by Al-Muhajabah, "In the MTSQL code where you want the next entry in the category to show up, it should be ASC LIMIT 1 not DESC. Otherwise you get the most recent entry in the category."

Requirements
An installation of Movable Type running with a MySQL database
Installation of two Brad Choate plugins
- MTSQL
- IfEmpty

Corrected code available as a text file.

Please refer to the forum topic if you have questions.

update 040214: Phil Ringnalda's Previous/Next in Category plugin does this, too.

Examples
Sugarpuss Clothing: one blog, 5 or 6 categories used for galleries in various sections. Probably not worksafe, it's a clothing and lingerie show with lots of scantily-clad honeys roaming about.

pho: personal photoblog, uses prev/next chronologically and by category

Drawback
These methods only use primary category, which is fine for Sugarpuss, where each entry is only assigned one category and goes in one gallery, but doesn't work so well on pho, where many entries have secondary categories.

Reminder to self: try sticking it all in an <MTCategories> list. Or ask someone more competent than me to figure it out.

Related
Category navigation links
Ramblings of a Code Monkey: NOT Filter for Categories
Mark Pasc: CatEntries plugin

Posted by gwen at January 22, 2004 01:27 PM | TrackBack
Comments