Skip to content
Snippets Groups Projects
Name Last commit Last update
src
.editorconfig
.gitignore
readme.md

Mediawiki - WikiTabs

Description

JavaScript logic to dynamically split mediawiki page content into clickable tabs.

Tabs will filter all content, based on what was underneath the H2 header of the corresponding name.

Notes

  • Tabbing will only be created if desired H2 headers are specified. Otherwise tabbing logic defaults to "off" and thus does nothing.
  • Tabbing is considered "on" and attempts to generate if H2 headers are specified. But it will only manipulate the page if two or more matching headers are found.
  • Whenever tabbing generates, the first tab will always be "All", which will display the original full page content, as it was prior to any manipulation.
  • Any H2 headers that are not found in the specified list will be grouped into the last tab, marked as "Other".

To specify tab headers, an html element should be generated to the page in the format of:

<div id="wikitabs-template-variables">["H2 Header Value #1", "H2 Header Value #2"]</div>

Each "H2 Header Value" string should replaced by the title of an actual H2 on the page, that is desired to show up as a tab.

In this example, only two headers are provided, but any amount can be provided. Note that three to five headers is recommended, as any more starts to crowd the page.