« The Future of Rayners.Org | Main | Friday Ten (Dec 23) »

December 21, 2004

ParentCategoryRebuild 1.0

This plugin will automatically rebuild the category archives for the parent categories of the categories to which an entry has been assigned. The idea is that if you are using MTEntriesWithSubCategories in your category archive templates, you will want those category archives to be rebuilt when an entry is saved. However, the normal behavior is only to rebuild those categories to which the entry is directly assigned. So I ripped the code that performed the parent category archive rebuilding from the last version of the SubCategories plugin, cleaned it up, and here it is.

Download one of the following files:

Unpack it, place parent_rebuild.pl in your plugins directory, and you are all set.

( Note: this plugin is using a callback that was introduced in MT 3.1, so it will not work in earlier versions )

Posted by rayners at December 21, 2004 04:30 PM

Trackback Pings

TrackBack URL for this entry:
http://mt.rayners.org/mt-tb.cgi/380

Comments

Yay thanks!

Posted by: Arvind at December 22, 2004 01:12 AM

Good stuff. How about building category pages for categories that do not contain entries but do have subcategories containing entries? That's stumping a few people.

Posted by: Reason at December 28, 2004 12:16 AM

Just what I was looking for! Yet again you save the day!

Posted by: Sean at February 5, 2005 11:35 AM

This is a great plugin, and satisfies a need I suddenly found unmet.

One comment, though. It only rebuilds the category pages if I update or write a new entry. If a category template is updated, and I rebuild all category pages, it doesn't rebuild the empty category.

I guess the trick is to always rebuild all pages, or at least update an entry so that the empty categories will be rebuilt.

Posted by: Rob K at August 8, 2005 08:58 PM

Hi there,

I've just installed this in 3.2 and get the following error int eh activity log:-

ParentCategoryRebuild died with: Can't locate object method "rebuildentryarchivetype" via package "MT::App::CMS" at /home/6579/robsharp/www.boringbutgood.com/publichtml/mt/plugins/parentrebuild.pl line 24.

Is this compatable with 3.2 ? It sounds like it will resolve the exact problem I am having....

Rob (email :- typekey2.store@neverbox.com )

Posted by: Robmonster [TypeKey Profile Page] at November 24, 2005 07:42 AM

Post a comment




Remember Me?

(you may use HTML tags for style)