Last modified: 2007-01-11 21:13:26 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T7135, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 5135 - Custom namespace handlers
Custom namespace handlers
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
1.8.x
All All
: Normal enhancement with 2 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-02-28 22:45 UTC by Juliano F. Ravasi
Modified: 2007-01-11 21:13 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Possible implementation (3.22 KB, patch)
2006-02-28 22:48 UTC, Juliano F. Ravasi
Details

Description Juliano F. Ravasi 2006-02-28 22:45:25 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.
Comment 1 Juliano F. Ravasi 2006-02-28 22:48:49 UTC
Created attachment 1422 [details]
Possible implementation

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.
Comment 2 Daniel Kinzler 2006-11-05 11:16:17 UTC
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 ***
Comment 3 Jelte (WebBoy) 2006-11-06 19:48:59 UTC
Sorry, the namespace manager does not contain this function.
Comment 4 Juliano F. Ravasi 2007-01-11 21:13:26 UTC
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:

r1=16209&r2=16210">http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/Wiki.php?view=diff&r1=16209&r2=16210

Thanks Tim Starling!

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links