Extension:BaseHooks
![]() | This extension is currently not actively maintained! Although it may still work, any bug reports or feature requests will more than likely be ignored. If you are interested in taking on the task of developing and maintaining this extension, you can request repository ownership. As a courtesy, you may want to contact the author. You should also remove this template and list yourself as maintaining the extension in the page's {{extension}} infobox. |
BaseHooks Release status: unmaintained |
|
---|---|
Description | add strings or files before end of body tag |
Author(s) | (VictorPortontalk) |
Latest version | 0.1.0-alpha |
License | GNU General Public License 2.0 or later |
Download | |
|
|
unknown | |
Translate the BaseHooks extension if it is available at translatewiki.net | |
The BaseHooks extension inserts strings or files specified at LocalSettings.php before end of body tag. As new hooks will be added in new MediaWiki versions, this extension may be extended to more "insertion points" (hooks).
Installation[edit]
- Download and place the file(s) in a directory called
BaseHooks
in yourextensions/
folder. - Add the following code at the bottom of your LocalSettings.php:
wfLoadExtension( 'BaseHooks' );
Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
To users running MediaWiki 1.24 or earlier:
The instructions above describe the new way of installing this extension using wfLoadExtension()
.
If you need to install this extension on these earlier versions (MediaWiki 1.24 and earlier), instead of wfLoadExtension( 'BaseHooks' );
, you need to use:
require_once "$IP/extensions/BaseHooks/BaseHooks.php";
Configuration parameters[edit]
- $wgBaseHooksAfterBottomScriptsNamespaceStrings
- Hash table with keys being namespace IDs. Every element is an array of strings to be inserted before end of body tag
- $wgBaseHooksAfterBottomScriptsStrings
- An array of strings to be inserted before end of body tag
- $wgBaseHooksAfterBottomScriptsNamespaceFiles
- Hash table with keys being namespace IDs. Every element is an array of file names to be inserted before end of body tag
- $wgBaseHooksAfterBottomScriptsFiles
- An array of file names to be inserted before end of body tag
require_once "$IP/extensions/BaseHooks/BaseHooks.php";
$wgBaseHooksAfterBottomScriptsStrings = array("<!-- XYZ test. -->");
$wgBaseHooksAfterBottomScriptsFiles = array("$IP/extensions/BaseHooks/tests/test.inc");
In the current version strings are always inserted before files, but this may change in the future version of this extension.
You can use $wgBaseHooksAfterBottomScriptsNamespaceStrings and/or $wgBaseHooksAfterBottomScriptsNamespaceFiles to override settings for certain namespaces. For example if you set
$wgBaseHooksAfterBottomScriptsNamespaceStrings[NS_PROJECT] = array();
$wgBaseHooksAfterBottomScriptsNamespaceFiles[NS_PROJECT] = array();
then nothing will be added to pages of Project: namespace by this module.
TODO[edit]
Should override also
$wgHooks['SkinBuildSidebar'][]
Other callbacks?