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 )

5 Comments

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.

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

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.

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 "_rebuild_entry_archive_type" via package "MT::App::CMS" at /home/6579/robsharp/www.boringbutgood.com/public_html/mt/plugins/parent_rebuild.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 )

Leave a comment

Recent Entries

  • Plugin Writing 101

    So, I’m planning on writing up some entries about various aspects of plugin development. While I have a couple topics already in mind, I thought...

  • The Olympics Make Me Want To Compete Again

    Every time the Olympics come around (most the summer ones) I always start to delude myself into thinking I could complete once again in the...

  • Minimalist plugins are fun!

    Last night I whipped up one of the smallest plugins I’ve ever written. It is so small in fact that I was able to stuff...

  • Feedburner Widget on MT News

    Movable Type News A WordPress 2.5 Upgrade Guide: And of course there are lots of third-party plugins for the MT dashboard, to integrate statistics and...

  • AD&D Monster Stats for the Presidential Canditates

    Charles Stross (scifi author, D&D nerd, and former perl columnist) posted Politics as she is Played with 3d6: The recent death of Gary Gygax, who...

Close