[WikiEN-l] Re: A first encounter with Categories

Timwi timwi at gmx.net
Mon Jun 7 17:31:14 UTC 2004


Viajero wrote:

> They aren't even consistently labelled! It is entirely possible,
> perhaps probable that someone will come along and create 
> "Category:Contraltos opera singers" "Category:Tenors".

I have thought of this problem before, and I have come up with a 
solution, so here it is. Discussion is encouraged.

I think it should be possible to create a redirect between categories:

   CATEGORY:TENORS
   ---------------
   1. REDIRECT [[Category:Tenor opera singers]]

(nothing new so far) and then, either one of the following things should 
happen:

1. The category [[Category:Tenor opera singers]] should display all
    articles that are categorised in categories that redirect to it.
    This is probably too database-intensive because it potentially
    involves several database read queries;

2. Saving an article with [[Category:Tenors]] in it should automatically
    replace it with [[Category:Tenor opera singers]] before storing in
    the DB. This would only involve one extra read query per saved
    article that has a category tag.

The latter option has the added bonus that we can then allow categories 
to be moved using the "Move" function, which automatically generates a 
redirect. The new category name won't immediately display all the 
articles, but the next time those articles are edited, the category tag 
will automatically be updated.

Happy implementing! ;-)
Timwi




More information about the WikiEN-l mailing list