Template:Tabs

From Zelda Wiki, the Zelda encyclopedia
Revision as of 00:09, 27 September 2020 by PhantomCaleb (talk | contribs) (+Guidelines and instructions for importing on other wikis, since folks have asked before.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Purpose

Used to alternate among related views within the same context.

Usage

{{Tabs
|tab1= 
|content1= 

|tab2= 
|content2= 

|tab3= 
|content3= 

|tab4= 
|content4= 

|tab5= 
|content5= 

|tab6= 
|content6= 

|tab7= 
|content7= 

|tab8= 
|content8= 
}}
ParameterStatusDescriptionAccepted valuesDefault value
alignoptionalHorizontal alignment of the tab container and its contents.
  • left
  • center
left
columnsoptionalA number. If specified, the tab buttons will attempt to arrange themselves in N columns of equal width.
defaultoptionalA number. The index of the default tab.1
distributionoptionalIf set to stretch, the tab buttons will stretch to fill the space afforded by the tab container. Incompatible with columns.
  • stretch
positionoptionalThe vertical positioning of the tab buttons in relation to their content.
  • top
  • bottom
top
taboptionalThe label for the tab button.
tooltipoptionalTooltip to display when hovering on the tab button. Must be plain text without markup.
contentoptionalThe content to display for the tab.

Examples

InputOutput
{{Tabs
|tab1= Tab 1
|content1= Content 1111111111111111111111111111111111

|tab2= Tab 2
|content2= Content 2222222222222222222222222222222222

|tab3= Tab 3
|content3= Content 3333333333333333333333333333333333
}}
Tab 1Tab 2Tab 3
Content 1111111111111111111111111111111111
Content 2222222222222222222222222222222222
Content 3333333333333333333333333333333333
{{Tabs
|align= center

|tab1= Tab 1
|tooltip1= First Tab
|content1= Content 1111111111111111111111111111111111

|tab2= Tab 2
|tooltip2= Second Tab
|content2= Content 2222222222222222222222222222222222

|tab3= Tab 3
|tooltip3= Third Tab
|content3= Content 3333333333333333333333333333333333
}}
Tab 1Tab 2Tab 3
Content 1111111111111111111111111111111111
Content 2222222222222222222222222222222222
Content 3333333333333333333333333333333333
{{Tabs
|align= center
|default= 2
|position= bottom

|tab1= Tab 1
|content1= Content 1111111111111111111111111111111111

|tab2= Tab 2
|content2= Content 2222222222222222222222222222222222

|tab3= Tab 3
|content3= Content 3333333333333333333333333333333333
}}
Content 1111111111111111111111111111111111
Content 2222222222222222222222222222222222
Content 3333333333333333333333333333333333
Tab 1Tab 2Tab 3
{{Tabs
|distribution= stretch

|tab1= Tab 1
|content1= Content 1111111111111111111111111111111111

|tab2= Tab 2
|content2= Content 2222222222222222222222222222222222

|tab3= Tab 3
|content3= Content 3333333333333333333333333333333333
}}
Tab 1Tab 2Tab 3
Content 1111111111111111111111111111111111
Content 2222222222222222222222222222222222
Content 3333333333333333333333333333333333
{{Tabs
|align= center
|columns= 2

|tab1= [[File:OOS Spring.png|link=]]
|tooltip1= Spring
|content1= [[File:Holodrum Spring.png|300px]]

|tab2= [[File:OOS Summer.png|link=]]
|tooltip2= Summer
|content2= [[File:Holodrum Summer.png|300px]]

|tab3= [[File:OOS Autumn.png|link=]]
|tooltip3= Autumn
|content3= [[File:Holodrum Autumn.png|300px]]

|tab4= [[File:OOS Winter.png|link=]]
|tooltip4= Winter
|content4= [[File:Holodrum Winter.png|300px]]
}}
OOS Spring.pngOOS Summer.pngOOS Autumn.pngOOS Winter.png
Holodrum Spring.png
Holodrum Summer.png
Holodrum Autumn.png
Holodrum Winter.png

Used to alternate among related views within the same context.

Template parameters

ParameterDescriptionTypeStatus
alignalign

Horizontal alignment of the tab container and its contents.

Stringoptional
columnscolumns

A number. If specified, the tab buttons will attempt to arrange themselves in N columns of equal width.

Numberoptional
defaultdefault

A number. The index of the default tab.

Numberoptional
distributiondistribution

If set to <code>stretch</code>, the tab buttons will stretch to fill the space afforded by the tab container. Incompatible with <code>columns</code>.

Stringoptional
positionposition

The vertical positioning of the tab buttons in relation to their content.

Stringoptional
Tab1tab1

The label for the tab button.

Stringoptional
Tooltip1tooltip1

Tooltip to display when hovering on the tab button. Must be plain text without markup.

Stringoptional
Content1content1

The content to display for the tab.

Stringoptional
Tab2tab2

The label for the tab button.

Stringoptional
Tooltip2tooltip2

Tooltip to display when hovering on the tab button. Must be plain text without markup.

Stringoptional
Content2content2

The content to display for the tab.

Stringoptional
Tab3tab3

The label for the tab button.

Stringoptional
Tooltip3tooltip3

Tooltip to display when hovering on the tab button. Must be plain text without markup.

Stringoptional
Content3content3

The content to display for the tab.

Stringoptional
Tab4tab4

The label for the tab button.

Stringoptional
Tooltip4tooltip4

Tooltip to display when hovering on the tab button. Must be plain text without markup.

Stringoptional
Content4content4

The content to display for the tab.

Stringoptional
Tab5tab5

The label for the tab button.

Stringoptional
Tooltip5tooltip5

Tooltip to display when hovering on the tab button. Must be plain text without markup.

Stringoptional
Content5content5

The content to display for the tab.

Stringoptional
Tab6tab6

The label for the tab button.

Stringoptional
Tooltip6tooltip6

Tooltip to display when hovering on the tab button. Must be plain text without markup.

Stringoptional
Content6content6

The content to display for the tab.

Stringoptional
Tab7tab7

The label for the tab button.

Stringoptional
Tooltip7tooltip7

Tooltip to display when hovering on the tab button. Must be plain text without markup.

Stringoptional
Content7content7

The content to display for the tab.

Stringoptional
Tab8tab8

The label for the tab button.

Stringoptional
Tooltip8tooltip8

Tooltip to display when hovering on the tab button. Must be plain text without markup.

Stringoptional
Content8content8

The content to display for the tab.

Stringoptional

Guidelines

  • Tabs should represent the same kind of content. Don’t use tabs to group content that is dissimilar.
  • Tabs can be used to add a third dimension to data tables. See Kafei#Schedule, for example.
  • Images can be used as labels on the tab buttons. In this case you must remove the link from the image with link=, otherwise clicking on the tab will link to the file page instead of switching the tab.
  • Tabs should be clearly labeled and self-evident. If abbreviations must absolutely be used to save space – or if using images – include a tooltip to properly describe the tab.

Use on Other Wikis

If you are from another wiki and wish to have tabs on your wiki, here are instructions for copying over the code. Please give credit and link back to Zelda Wiki if you do so.

1. Copy the following pages:

2. Enable Extension:Gadgets on your wiki.

3. Add an entry to MediaWiki:Gadgets-definition on your wiki. Example