Editing Template:Tab
From Metroid Wiki
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
{{#vardefine:name|{{{name|tab}}}}}<!-- | |||
-->{{#vardefine:TabCount|{{TempCounter|{{{tab1}}}|{{{tab2|}}}|{{{tab3|}}}|{{{tab4|}}}|{{{tab5|}}}|{{{tab6|}}}|{{{tab7|}}}|{{{tab8|}}}|{{{tab9|}}}|{{{tab10|}}}|{{{tab11|}}}|{{{tab12|}}}}}}}<!-- | |||
-->{{#vardefine:TabA|{{!}} style="{{round}}; width: 4px; border: none; background: none;" {{!}} {{!}}{{!}}}}<!-- | |||
-->{{# | -->{{#vardefine:TabB|style="{{round}}; font-size: 90%; whitespace: nowrap; padding-left: 2px; padding-right: 2px; margin: 20px; border: 2px solid #{{Mw color light}}; border-bottom: 1px solid #{{Mw color light}}; background: #{{Mw color}};"}}<!-- | ||
-->{{# | -->{{#vardefine:TabC|{{!}} style="{{round}}; width: 30px; border: none; background: none;" {{!}} }}<!-- | ||
-->{{# | -->{{#vardefine:UpperTabs|{{#switch:{{#var:TabCount}} | ||
|7= | |||
{{#var:TabA}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}5">{{{tab5}}}</span> | |||
{{#var:TabA}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}6">{{{tab6}}}</span> | |||
{{#var:TabA}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}7">{{{tab7}}}</span> | |||
|8= | |||
{{#var:TabA}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}5">{{{tab5}}}</span> | |||
{{#var:TabA}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}6">{{{tab6}}}</span> | |||
{{#var:TabA}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}7">{{{tab7}}}</span> | |||
{{#var:TabA}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}8">{{{tab8}}}</span> | |||
{{{ | |9= | ||
{{#var:TabA}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}6">{{{tab6}}}</span> | |||
{{{ | {{#var:TabA}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}7">{{{tab7}}}</span> | ||
{{#var:TabA}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}8">{{{tab8}}}</span> | |||
{{{ | {{#var:TabA}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}9">{{{tab9}}}</span> | ||
|10= | |||
{{{ | {{#var:TabA}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}6">{{{tab6}}}</span> | ||
{{#var:TabA}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}7">{{{tab7}}}</span> | |||
{{{ | {{#var:TabA}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}8">{{{tab8}}}</span> | ||
{{#var:TabA}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}9">{{{tab9}}}</span> | |||
{{{ | {{#var:TabA}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}10">{{{tab10}}}</span> | ||
|11= | |||
{{{ | {{#var:TabA}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}7">{{{tab7}}}</span> | ||
{{#var:TabA}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}8">{{{tab8}}}</span> | |||
{{{ | {{#var:TabA}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}9">{{{tab9}}}</span> | ||
{{#var:TabA}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}10">{{{tab10}}}</span> | |||
{{{ | {{#var:TabA}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}11">{{{tab11}}}</span> | ||
|12= | |||
{{{ | {{#var:TabA}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}7">{{{tab7}}}</span> | ||
{{#var:TabA}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}8">{{{tab8}}}</span> | |||
{{{ | {{#var:TabA}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}9">{{{tab9}}}</span> | ||
{{#var:TabA}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}10">{{{tab10}}}</span> | |||
{{{ | {{#var:TabA}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}11">{{{tab11}}}</span> | ||
--></ | {{#var:TabA}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}12">{{{tab12}}}</span> | ||
}}}}<!-- | |||
-->{{#vardefine:LowerTabs|{{#switch:{{#var:TabCount}} | |||
|1= | |||
{{#var:TabC}} | |||
{{!}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}1">{{{tab1}}}</span> | |||
{{#var:TabC}} | |||
|2= | |||
{{#var:TabC}} | |||
{{!}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}1">{{{tab1}}}</span> | |||
{{#var:TabA}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}2">{{{tab2}}}</span> | |||
{{#var:TabC}} | |||
|3= | |||
{{#var:TabC}} | |||
{{!}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}1">{{{tab1}}}</span> | |||
{{#var:TabA}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}2">{{{tab2}}}</span> | |||
{{#var:TabA}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}3">{{{tab3}}}</span> | |||
{{#var:TabC}} | |||
|4= | |||
{{#var:TabC}} | |||
{{!}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}1">{{{tab1}}}</span> | |||
{{#var:TabA}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}2">{{{tab2}}}</span> | |||
{{#var:TabA}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}3">{{{tab3}}}</span> | |||
{{#var:TabA}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}4">{{{tab4}}}</span> | |||
{{#var:TabC}} | |||
|5= | |||
{{#var:TabC}} | |||
{{!}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}1">{{{tab1}}}</span> | |||
{{#var:TabA}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}2">{{{tab2}}}</span> | |||
{{#var:TabA}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}3">{{{tab3}}}</span> | |||
{{#var:TabA}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}4">{{{tab4}}}</span> | |||
{{#var:TabA}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}5">{{{tab5}}}</span> | |||
{{#var:TabC}} | |||
|6= | |||
{{#var:TabC}} | |||
{{!}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}1">{{{tab1}}}</span> | |||
{{#var:TabA}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}2">{{{tab2}}}</span> | |||
{{#var:TabA}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}3">{{{tab3}}}</span> | |||
{{#var:TabA}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}4">{{{tab4}}}</span> | |||
{{#var:TabA}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}5">{{{tab5}}}</span> | |||
{{#var:TabA}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}6">{{{tab6}}}</span> | |||
{{#var:TabC}} | |||
|7|8= | |||
{{!}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}1">{{{tab1}}}</span> | |||
{{!}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}2">{{{tab2}}}</span> | |||
{{!}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}3">{{{tab3}}}</span> | |||
{{!}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}4">{{{tab4}}}</span> | |||
|9|10= | |||
{{!}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}1">{{{tab1}}}</span> | |||
{{!}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}2">{{{tab2}}}</span> | |||
{{!}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}3">{{{tab3}}}</span> | |||
{{!}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}4">{{{tab4}}}</span> | |||
{{!}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}5">{{{tab5}}}</span> | |||
|11|12= | |||
{{!}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}1">{{{tab1}}}</span> | |||
{{!}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}2">{{{tab2}}}</span> | |||
{{!}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}3">{{{tab3}}}</span> | |||
{{!}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}4">{{{tab4}}}</span> | |||
{{!}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}5">{{{tab5}}}</span> | |||
{{!}} {{#var:TabB}} {{!}} <span class="_toggler_hide-{{#var:name}}s _toggler_show-{{#var:name}}6">{{{tab6}}}</span> | |||
}}}} | |||
{| align="center" style="{{round}}; {{#if:{{{width|}}}|width:{{{width|}}};}} clear: both; text-align: center; {{#if:{{{header|}}}|margin: 0.3em auto; background: #{{Mw color}}; border: 1px solid #{{Mw color light}};}}" | |||
{{#if:{{{header|}}}|{{!-}} | |||
{{!}} valign="middle" style="{{round}}; text-align: center; width: 98%; background-color:#{{Mw color}}; border: 1px solid #{{Mw color light}}" {{!}}<div style="{{round}}; text-align:center;position:relative;white-space:nowrap;">'''{{{header}}}'''</div>}} | |||
|- | |||
| style="{{round}}; padding-top: 15px;" valign="top"| <div style="{{round}}; position: top; border: 0px;"> <div style="position: relative; text-align: center; padding-bottom: 0px; background-color: transparent; border-bottom: 2px solid #{{Mw color light}}; "> | |||
{{#ifexpr: {{#var:TabCount}} > 6| | |||
<table style="position: relative; " align="center" cellpadding="0" cellspacing="0" width=100%> | |||
{{#var:UpperTabs}} | |||
{{#var:TabA}} | |||
</table> | |||
}} | |||
{| style="{{round}}; position: relative; " align="center" cellpadding="0" cellspacing="0" width=100% | |||
{{#var:LowerTabs}} | |||
|} </div> | |||
<div style="{{round}}; position: relative; font-size: 90%; padding-top: 3px; padding-left: 10px; padding-right: 10px; background: none; border: 2px solid #{{Mw color light}}; border-top:0px; {{#if:{{{height|}}}|height:{{{height|}}};}}"> | |||
<div class="tabcontent"> | |||
{{#ifeq:{{{default|1}}} | |||
|1 | |||
|{{toggle|{{{content1|}}}||{{#var:name}}1 {{#var:name}}s}} | |||
|{{toggle||{{{content1|}}}|{{#var:name}}1 {{#var:name}}s}} | |||
}} | |||
{{#ifeq:{{{default}}} | |||
|2 | |||
|{{toggle|{{{content2|}}}||{{#var:name}}2 {{#var:name}}s}} | |||
|{{toggle||{{{content2|}}}|{{#var:name}}2 {{#var:name}}s}} | |||
}} | |||
{{#ifeq:{{{default}}} | |||
|3 | |||
|{{toggle|{{{content3|}}}||{{#var:name}}3 {{#var:name}}s}} | |||
|{{toggle||{{{content3|}}}|{{#var:name}}3 {{#var:name}}s}} | |||
}} | |||
{{#ifeq:{{{default}}} | |||
|4 | |||
|{{toggle|{{{content4|}}}||{{#var:name}}4 {{#var:name}}s}} | |||
|{{toggle||{{{content4|}}}|{{#var:name}}4 {{#var:name}}s}} | |||
}} | |||
{{#ifeq:{{{default}}} | |||
|5 | |||
|{{toggle|{{{content5|}}}||{{#var:name}}5 {{#var:name}}s}} | |||
|{{toggle||{{{content5|}}}|{{#var:name}}5 {{#var:name}}s}} | |||
}} | |||
{{#ifeq:{{{default}}} | |||
|6 | |||
|{{toggle|{{{content6|}}}||{{#var:name}}6 {{#var:name}}s}} | |||
|{{toggle||{{{content6|}}}|{{#var:name}}6 {{#var:name}}s}} | |||
}} | |||
{{#ifeq:{{{default}}} | |||
|7 | |||
|{{toggle|{{{content7|}}}||{{#var:name}}7 {{#var:name}}s}} | |||
|{{toggle||{{{content7|}}}|{{#var:name}}7 {{#var:name}}s}} | |||
}} | |||
{{#ifeq:{{{default}}} | |||
|8 | |||
|{{toggle|{{{content8|}}}||{{#var:name}}8 {{#var:name}}s}} | |||
|{{toggle||{{{content8|}}}|{{#var:name}}8 {{#var:name}}s}} | |||
}} | |||
{{#ifeq:{{{default}}} | |||
|9 | |||
|{{toggle|{{{content9|}}}||{{#var:name}}9 {{#var:name}}s}} | |||
|{{toggle||{{{content9|}}}|{{#var:name}}9 {{#var:name}}s}} | |||
}} | |||
{{#ifeq:{{{default}}} | |||
|10 | |||
|{{toggle|{{{content10|}}}||{{#var:name}}10 {{#var:name}}s}} | |||
|{{toggle||{{{content10|}}}|{{#var:name}}10 {{#var:name}}s}} | |||
}} | |||
{{#ifeq:{{{default}}} | |||
|11 | |||
|{{toggle|{{{content11|}}}||{{#var:name}}11 {{#var:name}}s}} | |||
|{{toggle||{{{content11|}}}|{{#var:name}}11 {{#var:name}}s}} | |||
}} | |||
{{#ifeq:{{{default}}} | |||
|12 | |||
|{{toggle|{{{content12|}}}||{{#var:name}}12 {{#var:name}}s}} | |||
|{{toggle||{{{content12|}}}|{{#var:name}}12 {{#var:name}}s}} | |||
}} | |||
</div></div></div> | |||
|}<noinclude> | |||
==Purpose== | ==Purpose== | ||
This template is a tool to create navigation templates with a tabbed layout. This condenses the overall size of the navigation template but still offers everything in it. | This template is a tool to create navigation templates with a tabbed layout. This condenses the overall size of the navigation template but still offers everything in it. This makes navigation templates with a lot of content far less intimidating and much easier to get around. | ||
This makes navigation templates with a lot of content far less intimidating | |||
==Usage== | ==Usage== | ||
This is a very complex template and has to be carefully used. It should usually only be used on other templates to create a navigation box. | This is a very complex template and has to be carefully used. It should usually only be used on other templates to create a navigation box. | ||
To use this template, start with this layout: | |||
To use this template, | |||
<pre> | <pre> | ||
{{Tab | {{Tab | ||
|name = | |||
|header = | |header = | ||
|width = | |||
|height = | |height = | ||
|default = | |default = | ||
Line 80: | Line 216: | ||
}} | }} | ||
</pre> | </pre> | ||
'''name''': A unique ID for the nav template that no other nav template has. It has to be unique and it can't have any special characters like commas, parenthesis, colons, ect. And it can't have any spaces. This is required to make sure it behaves correctly. If two nav templates that use this template are placed on the same page with the same name ID, they will not behave correctly. It also prevents possible bugs with other toggling functions. ''(Required.)'' | |||
'''header''': The content you want to display in the header field of the template. If left blank, the tabs will not be in a container. ''(Optional.)'' | |||
''' | '''width''': The width of the navigation template. Fits to the contents if left blank. You should base this on what makes the tabs themselves look best. ''(Optional.)'' | ||
'''height''': The height of the tab contents section. Fits to the contents if left blank. Base this on the largest content tab. Usually 20px per line works best. You may wish to add an addition 20px to account for the bolding that happens when you're on the page for a link, as this might add a new line. ''(Optional.)'' | '''height''': The height of the tab contents section. Fits to the contents if left blank. Base this on the largest content tab. Usually 20px per line works best. You may wish to add an addition 20px to account for the bolding that happens when you're on the page for a link, as this might add a new line. ''(Optional.)'' | ||
Line 89: | Line 228: | ||
'''tab#''': The name of each tab. Try to keep the names short. Long names will look bad. Limit of twelve tabs. You can also use images here. However, if you do, they should be entered with a blank <nowiki>link=</nowiki> parameter, or the linking to nothing option of [[Template:Image]], so the image doesn't link to any page. If you neglect to do this, clicking the tab will take you to the that page instead of loading the tab. ''(Required.)'' | '''tab#''': The name of each tab. Try to keep the names short. Long names will look bad. Limit of twelve tabs. You can also use images here. However, if you do, they should be entered with a blank <nowiki>link=</nowiki> parameter, or the linking to nothing option of [[Template:Image]], so the image doesn't link to any page. If you neglect to do this, clicking the tab will take you to the that page instead of loading the tab. ''(Required.)'' | ||
'''content#''': The content you want to display for each tab. There is no limit here, but you may want to insert line breaks and adjust the height | '''content#''': The content you want to display for each tab. There is no limit here, but you may want to insert line breaks and adjust the width and height parameters to make the whole template look its best. ''(Required.)'' | ||
==Examples== | ==Examples== | ||
To see examples of this template | To see examples of using this template, see the templates: | ||
[[Category:Formatting Templates]] | [[Category:Formatting Templates]] | ||
</noinclude> | </noinclude> |