Extension:Header Tabs

This extension transforms top-level MediaWiki headers into tabs using jQuery (with related jQuery UI) javascript libraries. The jQuery library that is used is a set of files contained in MediaWiki itself. In MediaWiki 1.16 and lower, [http://developer.yahoo.com/yui/ Yahoo! User Interface (YUI)] javascript libraries are used.

Usage
To enable tabs on a page after you installed the extension, you need to add a tag into the page in place where the last tab should end (everything below this tag will be shown under the tab view). Most of the time, though, you'll want to put it at the bottom of the page.

In addition to that, the page should have top-level headers defined in it like this: = Header title = Each such top-level header, if it's anywhere above the &lt;headertabs/&gt; tag, will be displayed as a tab.

Linking to tabs
You can link to a tab, both from another page and from within that same page (and, within that same page, both from another tab and from outside the tab view). This is done using the  parser function, which is called like this:

This will create a link to the tab with the name "Tab name", and the text of the link will read "Link text". If you want the link to a point to a tab on another page, you can optionally add the third parameter, "Page name".

Semantic MediaWiki factbox
In addition to user-defined tabs, Header Tabs can convert the Semantic MediaWiki factbox into a tab, and add it as the last tab in the tab view. This feature is currently only works in MediaWiki 1.16 and lower.

Example
Some text above the tab view

= First section header = This will be displayed on the first tab

= Second section header = This will be displayed on the second tab

= Third section header = This will be always displayed under the tab view because it's below the &lt;headertabs/&gt; tag.

The header titles get automatically converted into tab titles.

Download
You can download the Header Tabs code in either one of these files:
 * header_tabs_0.8.3.tar.gz
 * header_tabs_0.8.3.zip

You can also download the code directly via SVN from the MediaWiki source code repository, at http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/HeaderTabs/. From a command line, you can call the following:

To see a list of changes for each version, please see our version history. For a list features planned for future releases, please see roadmap

Changes since version 1.8.3: * Extension:Configure support * new 1.17+ options: **jquery to use RL **$htRenderSingleTab **$htAutomaticNamespaces **$htDefaultFirstTab **$htDisableDefaultToc **$htGenerateTabTocs **$htEditTabLink **$htStyle ***style 'jquery-large' ***style 'bare' ** history navigation ** mediawiki TOC links now work

Installation
First, download the code into your wiki's  folder.

Then add the following to LocalSettings.php:

Skin modification
If you wish to change the JQuery UI tabs styling in MW 1.17+, including removing the default JQuery styling, please see the /JQueryStyles section concerning the use of the  configuration variable.

If you want to override the YUI skin in MW 1.16 or earlier, feel free to modify your skin in the 'skins-yui' directory and assign skin class (e.g. ) to   tag. See YUI skinning documentation for more details.

Configuration parameters
The following parameters can be changed in the LocalSettings.php file below the :

In legacy MediaWiki 1.16 and lower, only the  setting is available and enabled.

$htUseHistory
The  variable defines whether tab navigation should be tracked within the browser history and within the URL, updating the hash value. By default this variable is set to true, i.e. history is used. You can disable it by adding the following:

$htRenderSingleTab
The  variable defines if Header Tabs will activate if only a single top-level header is found. By default this variable is set to true, i.e. no tabs will be shown if only one top-level header is found. You can disable this behaviour by adding the following:

$htAutomaticNamespaces
The  variable defines if you need to specify the   tag to enable tabs. If a namespace ID is defined in this variable, header tabs will activate automatically when you have two top-level headers (depending on your  setting) in an article. By default no namespaces turn on header tabs on automatically. You can add this behaviour by adding the following for each namespace:

$htDefaultFirstTab
The  variable defines if Header Tabs will take anything before the first defined header and put the contents into a default tab instead of as a header. By default this variable is set to false, i.e. all content above the first top-level header will appear as a header. You can enable this behaviour by adding the default name using the following:

$htDisableDefaultToc
The  variable defines if Header Tabs will disable the MediaWiki article TOC when tabs are enabled for a given article. This saves you the trouble of having to add  to your article. If tabs do are not enabled because of a lack of top-level headers, a TOC may still appear as normal. By default this variable is set to true, i.e. the mediawiki TOC is disabled if header tabs are shown. You can disable this behaviour by adding the following:

$htGenerateTabTocs
The  variable defines if Header Tabs will try to generate a TOC for each tab. By default this variable is set to false, i.e. no tab TOCs will be generated. You can enable this behaviour by adding the following:

$htEditTabLink
The  variable defines if Header Tabs will add a edit link to the right of the tabs which let you edit only the tabs' text. By default this variable is set to true, i.e. a edit link for the tab will be shown. You can disable this behaviour by adding the following:

$htStyle
The  variable defines what visual style is used for the tabs. By default this variable is set to 'jquery-large'. You can change the style by adding the following:

Valid packaged styles are:

A wider selection of user-made styles as well as information about how to create your own styles is on our /JQueryStyles page.

Known issues

 * When used with MediaWiki 1.16 and lower, this extension may break custom skins, because it overrides styles like body, table, pre, code etc. (it uses default YUI reset styles)
 * Header Tabs, when used with the MathJax extension, leads to faulty HTML, which results in a broken display in at least the Firefox web browser.
 * Header Tabs doesn't work with Extension:Terminology. The header tabs don't appear.
 * Using Extension:UsabilityInitiative, HT 0.8+, and MW 1.16.4+ will result in header tabs not working as described (due to a jQuery conflict).

Support
The best way to seek help with this extension is to send questions to mediawiki-l mailing list:

https://lists.wikimedia.org/mailman/listinfo/mediawiki-l

The extension maintainers, and active users and contributors, are on this list and will be able to help you.

Sites using this extension
See extension usage. If your wiki does not appear there, ask them to add it.

Alternate extensions

 * JQuery Tab Container