Template:Tabber/doc: Difference between revisions

From Elwiki
Line 11: Line 11:
*<code>$contentsstyle</code> - adds styles to content boxes
*<code>$contentsstyle</code> - adds styles to content boxes
*<code>$ulstyle</code> - adds styles to tab list
*<code>$ulstyle</code> - adds styles to tab list
*<code>$ulclass</code> - adds class to tab list


== Example usage ==
== Example usage ==

Revision as of 11:12, 19 March 2022

Overview

This is the refreshed version of Template:Tabs and what you should be using for making tabs now. This version is enhanced with Mobile Frontend support and is generally cleaned up. Also, the syntax has been updated.

Parameters

 Tip: All parameters get parsed as tab=content, unless they start with the $ sign.
  • $containerclass - adds a custom class to the wrapper of the tabs
  • $containerstyle - adds a style to the wrapper of the tabs
  • $tab[number]style - adds styles to the tab on the specified index
  • $tab[number]style - adds styles to the content box on the specified index
  • $tabstyle - adds styles to tabs
  • $contentsstyle - adds styles to content boxes
  • $ulstyle - adds styles to tab list
  • $ulclass - adds class to tab list

Example usage

{{Tabber
|$containerclass=test
|Orange=Content of tab 1
|Banana=Content of tab 2
|Grape=Content of tab 3
|Pie=Content of tab 4
}}

Result:

  • Orange
  • Banana
  • Grape
  • Pie

Content of tab 1

  Tip: Nested tabs are also supported.
  • Tab 1
  • Tab 2
  • Tab 3
  • Tab 4
  • Tab 1
  • Tab 2
  • Tab 3
  • Tab 4

Content of tab 1

  Warning: Templates do not work well with tables and other templates, but there is a workaround for that. Before providing the parameter's value that contains MediaWiki markup, use <dfn>{{</dfn> and insert <dfn>}}</dfn> at the end of the parameter's value. Using it is not required until you notice that something breaks.

Use like so:

  • Tab 1
  • Tab 2

{{

Orange Apple
Bread Pie
Butter Ice cream

}}

{{Tabber
|$containerclass=test
|Tab 1=<dfn>{{</dfn>
{| class="wikitable"
|'''Orange'''
|'''Apple'''
|-
|Bread
|Pie
|-
|Butter
|Ice cream 
|}
<dfn>}}</dfn>
|Tab 2=Content of tab 2
}}