Last modified: 2007-01-11 21:13:26 UTC
Currently, MediaWiki handles Category and Image pages specially when they are
displayed. This is hard coded in Wiki.php/MediaWiki::articleFromTitle(). It
would be nice if extensions could define their own namespace handling classes
without having to patch core MediaWiki code. The idea is to enable extensions to
define their own classes similar to CategoryPage and ImagePage, and assign them
to custom namespaces. This is possible with minimal changes to the core code,
and would allow extensions to redefine the behavior of article pages.
For example, for a given namespace, an extension could list additional
information after the page contents, change navigation/action/toolbox-links, or
simply display an extra image or a few namespace-specific links along the side
of the page.
A patch with a possible implementation follows.
Created attachment 1422 [details]
This is how I implemented this on my own MediaWiki installation.
There is one additional config var in DefaultSettings.php, and a few changed
lines in Wiki.php to load the namespace handling class. Also a new extension
type for SpecialVersion.php.
It looks like the concept of a "namespace manager" will be integrated into 1.9,
see bug 7803. I marked this as a dupe, since if I understand correctly, 7803
will cover the functionality requested here.
*** This bug has been marked as a duplicate of 7803 ***
Sorry, the namespace manager does not contain this function.
I think that this issue was effectively resolved in a different manner by the
new "ArticleFromTitle" hook introduced in r16210 (released with 1.8.0). The
documentation is still missing
(http://www.mediawiki.org/wiki/Manual:MediaWiki_hooks), but it is pretty
straightforward by looking into the code:
Thanks Tim Starling!