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

  • Must Be Doing Something Right

    It’s not because they say please and thank you so often (and appropriately). It’s not that they hug each other and say they’re sorry (eventually)...

  • Because tests and bugs are fun

    A colleague of mine just shared this particular frustration: yargh. my test passes if all of the objects are created within the same second, but...

  • Upgraded to MT 4.23

    So, yeah, it’s a month late or so, but I’ve been really busy. I finally upgraded this site to Movable Type 4.23. Maybe I’ll even...

  • I apologize about the feed updates

    I’m deploying a development version of my MediaConsumer plugin and a number of entries might appear as updated in feed readers as I start applying...

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

Close