Template:Page tabs: Difference between revisions
Jump to navigation
Jump to search
Created page with "<tabs> <tab name="Tab 1"> Content for Tab 1 </tab> <tab name="Tab 2"> Content for Tab 2 </tab> </tabs>" |
No edit summary Tag: Reverted |
||
Line 1: | Line 1: | ||
<tabs | <noinclude> | ||
This is an advanced template for creating tabbed content with a variable number of tabs. Usage: | |||
Content for | {{AdvancedTabs | ||
</ | |1=Tab 1 Name | ||
<tab name=" | |2=Tab 1 Content | ||
|3=Tab 2 Name | |||
</tab> | |4=Tab 2 Content | ||
</tabs> | |5=Tab 3 Name | ||
|6=Tab 3 Content | |||
...and so on for as many tabs as needed | |||
}} | |||
</noinclude> | |||
<includeonly> | |||
<tabs> | |||
{{#vardefine:tabcount|0}} | |||
{{#loop: | |||
{{#ifexpr:({{{@index}}} % 2) = 1 and {{{@index}}} <= {{#expr:{{NUMBEROFARGSB}}-1}}| | |||
{{#varincr:tabcount}} | |||
<tab name="{{{@index}}}"> | |||
{{{{{#expr:{{{@index}}}+1}}}} | |||
</tab> | |||
}} | |||
}} | |||
</tabs> | |||
</includeonly> |
Revision as of 03:49, 23 July 2024
This is an advanced template for creating tabbed content with a variable number of tabs. Usage: Template:AdvancedTabs