Manual:Hooks/SkinBuildSidebar
From MediaWiki.org
| SkinBuildSidebar | |
|---|---|
| Available from version 1.14.0 At the end of Skin::buildSidebar(). |
|
Define function: |
public static function onSkinBuildSidebar( $skin, &$bar ) { ... }
|
Attach hook: |
$wgHooks['SkinBuildSidebar'][] = 'MyExtensionHooks::onSkinBuildSidebar'; |
| Called from: | Skin.php |
For more information about attaching hooks, see Manual:Hooks.
For examples of extensions using this hook, see Category:SkinBuildSidebar extensions.
[edit] Details
- $skin: Skin object
- &$bar: Sidebar contents
Modify $bar to add or modify sidebar portlets.
[edit] Simple Example
$wgHooks['SkinBuildSidebar'][] = 'fnNewSidebarItem'; function fnNewSidebarItem( $skin, &$bar ) { $out .= "<ul>\n"; $out .= "<li>Test</li>\n"; $out .= "</ul>\n"; $bar[ 'name of heading' ] = $out; return true; }