Manual:Hooks/SkinTemplateTabs

From MediaWiki.org
Jump to: navigation, search
SkinTemplateTabs
Available from version 1.6.0 (r12033)
Removed in version 1.18.0


Define function:
public static function onSkinTemplateTabs( $skin, &$content_actions ) { ... }

Attach hook:
$wgHooks['SkinTemplateTabs'][] = 'MyExtensionHooks::onSkinTemplateTabs';
Called from: SkinTemplate.php

For more information about attaching hooks, see Manual:Hooks.
For examples of extensions using this hook, see Category:SkinTemplateTabs extensions.


Note: If you're wondering why your extension broke with the Vector skin, please see Manual:Hooks/SkinTemplateNavigation. Vector uses a different hook.


Warning Warning: MediaWiki 1.18 now uses the Vector-style hook for all skins, please see Manual:Hooks/SkinTemplateNavigation for the vector and 1.18 equivalent of this hook.

[edit] Details

Called after building the $content_actions array, but before returning it. The $content_actions array can be modified to add/remove tabs.

Typically if you want to add new tab with caption mytab that has hyperlink to the page http://ex.org/mypage you should add a new element to the $content_actons array in your function :

 $content_actions['newtab'] = array (
 'class' => false,
 'text'  => 'mytab',
 'href'  => 'http://ex.org/mypage',
);
  • Tip: Always return true, otherwise other extensions that have hooked this event will not function properly!

[edit] Arguments

  • $skin: the skin it was called from
  • $content_actions: The array of content actions. Each content action is an array that includes text of the caption of the tab and hyperlink.
Personal tools
Namespaces

Variants
Actions
Navigation
Support
Download
Development
Communication
Print/export
Toolbox