Template:Start tab
Templates {{Start tab}} and {{End tab}} create a tabbed interface on project, help, portal and user pages.
Usage
{{Start tab
|tab-1 =
|link-1 =
|image-1 =
|rounding =
|border =
|off tab class =
|on tab class =
|off tab color =
|on tab color =
|tab spacing percent =
|tab font-size =
|tab alignment =
|nowrap =
|frame =
|frame color =
|no margin =
|freeform-1 =
|link2-1 =
|link3-1 =
|link4-1 =
|link5-1 =
}}
Place {{Start tab}} at the top of the page and {{End tab}} at the end. {{End tab}} is required somewhere on the page (except in talk namespaces) to close two <div> tags left open by {{Start tab}}. If {{Start tab}} uses |frame=no, {{End tab}} is not required.
Parameters ending in -1 below stand for a whole numbered series: tab-1 … tab-20, link-1 … link-20, and so on. {{Start tab}} supports up to 20 tabs; {{End tab}} (which provides the "next page" feature) supports up to 10.
Each tab needs a link-n (the title of the page it refers to) and a tab-n (its label). If the current page title matches a link-n, that tab is styled as selected. Otherwise the text in tab-n becomes a wikilink to the page given in link-n.
Freeform tabs: set freeform-n=yes to allow arbitrary wikitext in tab-n instead of plain text plus a link. When using freeform, leave link-n empty:
|freeform-1 = yes
|tab-1 = [http://www.nytimes.com/ ''The New York Times'']
|link-1 =
|image-1 =
For internal pages or subpages (sandboxes, talk page archives, etc.):
| freeform-2 = yes
| tab-2 = Sandbox ([[User:Example/Sandbox/1|1]] {{dot}} [[User:Example/Sandbox/2|2]] {{dot}} [[User:Example/Sandbox/3|3]])
Full syntax:
{{Start tab
|tab-1 = <!-- up to |tab-20= -->
|link-1 = <!-- up to |link-20= -->
|image-1 = <!-- up to |image-20= -->
|rounding =
|border =
|off tab class =
|on tab class =
|off tab color =
|on tab color =
|tab spacing percent =
|tab font-size =
|tab alignment =
|nowrap =
|frame =
|frame color =
|no margin =
}}
<!-- Text for main part of page goes here. -->
{{End tab
|tab-1 =
|link-1 =
|tab-2 =
|link-2 =
|tab-3 = <!-- up to |tab-10= -->
|link-3 = <!-- up to |link-10= -->
|off tab color =
|border =
|rounding =
}}
Template parameters
| Parameter | Description | Default | Status | |
|---|---|---|---|---|
tab-1 | Tab label | The name of the tab. Repeat as tab-2 … tab-20 (up to tab-10 in {{End tab}}). | empty | required |
link-1 | Tab link | The tab link location (page title). Repeat as link-2 … link-20. Leave empty when freeform-n=yes. | empty | required |
image-1 | Tab image | Name of an optional image (shown at 20px) placed next to the tab title. Repeat as image-2 … image-20. {{Start tab}} only. | empty | optional |
rounding | Rounding | Adds a rounding effect to the edges of the tab boxes (CSS length, e.g. 5em). | empty | optional |
border | Border | Border style (CSS, e.g. 1px solid #808080). | empty | optional |
off tab class | Off tab class | CSS class of the currently unselected tabs. {{Start tab}} only. | empty | optional |
on tab class | On tab class | CSS class of the currently selected tab. {{Start tab}} only. | empty | optional |
off tab color | Off tab color | Color of the currently unselected tabs. | empty | optional |
on tab color | On tab color | Color of the currently selected tab. {{Start tab}} only. | empty | optional |
tab spacing percent | Tab spacing percent | Overrides the width between the tabs. {{Start tab}} only. | empty | optional |
tab font-size | Tab font size | Overrides the font size of the text in the tabs. {{Start tab}} only. | empty | optional |
tab alignment | Tab alignment | Overrides the alignment of the tab titles. {{Start tab}} only. | empty | optional |
nowrap | No wrap | Prevents long names from wrapping on each tab. {{Start tab}} only. | empty | optional |
frame | Frame | Set to yes to add a page frame underneath the tabs. Does nothing in talk namespaces. Close it by adding </div></div> or {{End tab}} at the end of the page (or wherever the frame should close). Generally not recommended, as it breaks VisualEditor and the reply tool. | empty | optional |
frame color | Frame color | Background color for the frame. {{Start tab}} only. | value of on tab color | optional |
no margin | No margin | Set to yes to disable the margin between the tabs. {{Start tab}} only. | empty | optional |
freeform-1 | Freeform tab | Set to yes to allow arbitrary wikitext in tab-1 rather than plain text and a link; link-1 then stays empty. Repeat as freeform-2 … freeform-20. | empty | optional |
link2-1 | Second link | The tab's 2nd link location. Only applies when using freeform-n. Repeat as link2-2 … link2-20. | empty | optional |
link3-1 | Third link | The tab's 3rd link location. Only applies when using freeform-n. Repeat as link3-2 … link3-20. | empty | optional |
link4-1 | Fourth link | The tab's 4th link location. Only applies when using freeform-n. Repeat as link4-2 … link4-20. | empty | optional |
link5-1 | Fifth link | The tab's 5th link location. Only applies when using freeform-n. Repeat as link5-2 … link5-20. | empty | optional |
preums | Preums | Internal use only by {{Page tabs}}. Do not set manually. | empty | deprecated |
|
<templatedata>JSON</templatedata> ./. {{TemplateBox}}
TemplateData is a way to store information about template parameters (the description of those and of the whole template) for both humans and machines. It is used by VisualEditor and possibly other tools like Upload Wizard. Existing template documentation Newly created template documentation and imports Wikipedia's help about TemplateData • Commons-specific information Templates [[:Template:Start tab|<span style="font-family:monospace,monospace;">{{Start tab}}</span>]] and [[:Template:End tab|<span style="font-family:monospace,monospace;">{{End tab}}</span>]] create a tabbed interface on project, help, portal and user pages.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Additional information
The template is intended to be used in the following namespaces: no namespace specified
The template is intended to be used by the following user groups: all users
Placement: At the top of the page
See also
Localization
This template is not intended to be localized.
Examples
Basic, with frame
{{Start tab
| frame = yes
| tab-1 = Current page
| link-1 = Template:Start tab
| image-1 = Curly Brackets.svg
| tab-2 = Project
| link-2 = Wikipedia:WikiProject Athletics
| tab-3 = Project talk
| link-3 = Wikipedia talk:WikiProject Athletics
| tab-4 = Olympics Project
| link-4 = Wikipedia:WikiProject Olympics
| image-4 = Olympic Rings.svg
}}
Text for main part of page goes here.
{{End tab
| frame = yes
| tab-1 = Current page
| link-1 = Template:Start tab
| tab-2 = Project
| link-2 = Wikipedia:WikiProject Athletics
| tab-3 = Project talk
| link-3 = Wikipedia talk:WikiProject Athletics
| tab-4 = Olympics Project
| link-4 = Wikipedia:WikiProject Olympics
}}
| Project | Project talk |
Text for main part of page goes here.
With rounding
{{Start tab
| tab-1 = Current page
| link-1 = Template:Start tab
| image-1 = Curly Brackets.svg
| tab-2 = Project
| link-2 = Wikipedia:WikiProject Athletics
| tab-3 = Project talk
| link-3 = Wikipedia talk:WikiProject Athletics
| tab-4 = Olympics Project
| link-4 = Wikipedia:WikiProject Olympics
| image-4 = Olympic Rings.svg
| rounding = 5em
| border = 1px solid #808080
| off tab color = #f0f0ff
| tab alignment = center
| frame = yes
}}
Text for main part of page goes here.
{{End tab
| tab-1 = Current page
| link-1 = Template:Start tab
| tab-2 = Project
| link-2 = Wikipedia:WikiProject Athletics
| tab-3 = Project talk
| link-3 = Wikipedia talk:WikiProject Athletics
| tab-4 = Olympics Project
| link-4 = Wikipedia:WikiProject Olympics
| rounding = 5em
| border = 1px solid #808080
| off tab color = #f0f0ff
| frame = yes
}}
| Project | Project talk |
Text for main part of page goes here.