This extension is deprecated and no longer maintained by the developer. It may no longer work for current versions of MediaWiki and Bugs are no longer fixed. Please see the Deprecated section for more information.
Release status: stable
|Author(s)||Mathias Ertl (Mati talk)|
|License||GPL v3 or any later version.|
|Example||view the source-code of this page and search for 'wgMainArticlePage'.|
- The basepage of the current page, i.e. 'Foo' from the page 'Foo/Bar'. Please see the #BasePage-section if you are interested in imitating what this extension does.
- The name of the Resources-page in this wiki
- The name of the tab of the Resources-page in this wiki in its current configuration
Common.js relies on these variables to build the correct links to the resource-page. The name of the basepage is used on subpages so that the resource-tab links to the resource-page of the actual article and not to the resource-page of the resource. The other variables are used to have the correct translated names of the resource-special page if the user sets the language to something different then the standard in his UserPreferences.
The source code of this extension was hosted on git.fsinf.at, a project no longer maintained. Since this extension was so old, the git repository was not transfered to any other repository and the source code is no longer available.
Installation & Configuration
Simply download the file, put it in your extensions-directory and add this line in LocalSettings.php:
require_once( "$IP/AddBasePage/AddBasePage.php" );
Getting the name of the *true* base-page is actually not that trivial in MediaWiki. Title.php offers a function 'getBaseText' but that simply returns the title up to the first slash. Which is not always the base-page since a page-name may contain slashes and the returned text might not be the name of a page at all.
I solved this problem by simply adding a simple check if the return-value of getBaseText represents an existing page or not. If not, the page adds the full text instead. Note that this actually introduces a subtle bug: if the extension is used on a subpage where the title contains a slash it would add the subpage instead of the true base-page. Note that a simple call to getBaseText would add a non-existing page instead.
1.0.1 (rev. 186)
- fixed a bug that caused wgMainArticlePage to point to the discussion page if viewing a discussion page that doesn't exist
first version documented here
GPL v3 or any later version.
See also poker spiele