Template:Page tabs: Difference between revisions

From Dies Irae
Jump to navigation Jump to search
No edit summary
Tag: Reverted
No edit summary
Tag: Reverted
Line 1: Line 1:
<noinclude>
<noinclude>
  This is an advanced template for creating tabbed content with a variable number of tabs. Usage:
This template creates a tabbed interface using the Tabs extension.
  {{AdvancedTabs
 
  |1=Tab 1 Name
== Usage ==
  |2=Tab 1 Content
<pre>
  |3=Tab 2 Name
{{Tabs
  |4=Tab 2 Content
|class=optional-custom-class
  |5=Tab 3 Name
|default=1
  |6=Tab 3 Content
|tab1name=Tab 1 Title
  ...and so on for as many tabs as needed
|tab1content=Content for Tab 1
  }}
|tab2name=Tab 2 Title
  </noinclude>
|tab2content=Content for Tab 2
  <includeonly>
|tab3name=Tab 3 Title
  <tabs>
|tab3content=Content for Tab 3
  {{#vardefine:tabcount|0}}
|tab4name=Tab 4 Title
  {{#loop:
|tab4content=Content for Tab 4
    {{#ifexpr:({{{@index}}} % 2) = 1 and {{{@index}}} <= {{#expr:{{NUMBEROFARGSB}}-1}}|
|tab5name=Tab 5 Title
      {{#varincr:tabcount}}
|tab5content=Content for Tab 5
      <tab name="{{{@index}}}">
}}
      {{{{{#expr:{{{@index}}}+1}}}}
</pre>
      </tab>
 
    }}
* You can specify up to 5 tabs.
  }}
* The `class` and `default` parameters are optional.
  </tabs>
* Tabs 4 and 5 will only appear if content is provided for them.
  </includeonly>
 
== Examples ==
=== Basic Usage ===
<pre>
{{Tabs
|tab1name=Introduction
|tab1content=Welcome to our wiki.
|tab2name=Features
|tab2content=* Feature 1
* Feature 2
* Feature 3
|tab3name=Contact
|tab3content=Email: example@example.com
}}
</pre>
 
=== Advanced Usage ===
<pre>
{{Tabs
|class=my-custom-class
|default=2
|tab1name=About
|tab1content=About our company...
|tab2name=Products
|tab2content=Our product lineup...
|tab3name=Services
|tab3content=Services we offer...
|tab4name=Contact
|tab4content=How to reach us...
}}
</pre>
</noinclude>
 
<includeonly><tabs{{{class|}}} default="{{{default|1}}}">
{{{tab1name|<tab name="{{{tab1name|Tab 1}}}">
{{{tab1content|}}}
</tab>}}}
{{{tab2name|<tab name="{{{tab2name|Tab 2}}}">
{{{tab2content|}}}
</tab>}}}
{{{tab3name|<tab name="{{{tab3name|Tab 3}}}">
{{{tab3content|}}}
</tab>}}}
{{{tab4name|<tab name="{{{tab4name|}}}">
{{{tab4content|}}}
</tab>}}}
{{{tab5name|<tab name="{{{tab5name|}}}">
{{{tab5content|}}}
</tab>}}}
</tabs></includeonly>

Revision as of 03:52, 23 July 2024

This template creates a tabbed interface using the Tabs extension.

Usage

{{Tabs
|class=optional-custom-class
|default=1
|tab1name=Tab 1 Title
|tab1content=Content for Tab 1
|tab2name=Tab 2 Title
|tab2content=Content for Tab 2
|tab3name=Tab 3 Title
|tab3content=Content for Tab 3
|tab4name=Tab 4 Title
|tab4content=Content for Tab 4
|tab5name=Tab 5 Title
|tab5content=Content for Tab 5
}}
  • You can specify up to 5 tabs.
  • The `class` and `default` parameters are optional.
  • Tabs 4 and 5 will only appear if content is provided for them.

Examples

Basic Usage

{{Tabs
|tab1name=Introduction
|tab1content=Welcome to our wiki.
|tab2name=Features
|tab2content=* Feature 1
* Feature 2
* Feature 3
|tab3name=Contact
|tab3content=Email: example@example.com
}}

Advanced Usage

{{Tabs
|class=my-custom-class
|default=2
|tab1name=About
|tab1content=About our company...
|tab2name=Products
|tab2content=Our product lineup...
|tab3name=Services
|tab3content=Services we offer...
|tab4name=Contact
|tab4content=How to reach us...
}}