Jump to content

Topic on Extension talk:CategoryTree

Avoiding duplicates in the tree

1
WilkeKevin (talkcontribs)

On my wiki, I used to include all parent categories in the list of categories at the bottom of each page. For example, for a page named "Dachshund", in addition to the "Dog" category, I would also put the "Mammal" and "Animal" categories. Same for category pages, so on the "Dog" category page, I would assign it the "Mammal" and "Animal" categories, etc. I did it this way because I felt that when someone lists all members of the "Animal" category, they should see the subcategories and their pages as well. But that means you end up with a category tree like this:

 Animal
 + Dog
   + Dachshund
 + Mammal
   + Dog
     + Dachshund
   + Dachshund
 + Dachshund

This bothered me, so I made a patched version of the CategoryTree code that produces a tree like this:

 Animal
 + Mammal
   + Dog
     + Dachshund


But then I decided it wasn't worth the effort updating the patch for new MW releases, so I switched back to regular CategoryTree and I don't include parents, grandparents, etc. in categories and pages on my wiki anymore. Anyway, I just wanted to share my thoughts and experience.

Reply to "Avoiding duplicates in the tree"