Template:Page tabs: Difference between revisions

From Dies Irae
Jump to navigation Jump to search
No edit summary
Tag: Reverted
Replaced content with "<tabs> <tab name="Tab 1"> Content for Tab 1 </tab> <tab name="Tab 2"> Content for Tab 2 </tab> </tabs>"
Tags: Replaced Manual revert
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
<noinclude>
<tabs>
  This is an advanced template for creating tabbed content with a variable number of tabs. Usage:
<tab name="Tab 1">
  {{AdvancedTabs
Content for Tab 1
  |1=Tab 1 Name
</tab>
  |2=Tab 1 Content
<tab name="Tab 2">
  |3=Tab 2 Name
Content for Tab 2
  |4=Tab 2 Content
</tab>
  |5=Tab 3 Name
</tabs>
  |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>

Latest revision as of 04:29, 23 July 2024

Content for Tab 1

Content for Tab 2