FANDOM


Template:Documentation subpage Template:Lua Script error

This template is a metatemplate for the creation of sidebar templates, i.e. boxes that are vertically-aligned navigation templates. Sidebars, like infoboxes, are usually positioned on the right-hand side of a page.

Template:Tl is a version of Template:Tl that adds collapsibility to its sections, i.e. the means to show or hide sections by clicking links beside their headings.

Template:Navbox visibility

Usage (Sidebar)

Template:Generic template demo (parameters with infrequent use omitted)

{{Sidebar
| name = {{subst:PAGENAME}}
| pretitle = 
| title = 
| image = 
| headingstyle = 
| contentstyle = 

| above = 

| heading1 = 
| content1 = 

| heading2 = 
| content2 = 

| heading3 = 
| content3 = 

<!-- etc, to: -->

| heading35 = 
| content35 = 

| below = 

}}

Usage (Sidebar with collapsible lists)

Template:Generic template demo Parameters with infrequent use omitted.

{{Sidebar with collapsible lists
| name     = {{subst:PAGENAME}}
| pretitle = 
| title    = 
| image    = 
| expanded = {{{expanded|{{{1|}}}}}}

| headingstyle   = 
| listtitlestyle = 
| liststyle      = 
| contentstyle   =   <!--(same as |liststyle = ...?)-->

| heading1   = 
| list1name  = 
| list1title = 
| list1      = 

| heading2   = 
| list2name  = 
| list2title = 
| list2      = 

<!-- ...... -->

| headingN =         <!--(Template:Sidebar's "headingN" and/or "contentN" parameters (where -->
| contentN =         <!-- N is a number) may be used to include uncollapsible lists/content)-->

<!-- ...... -->

| below = 

}}

Parameters

No parameters are mandatory.

Principal parameters

Parameter Explanation
Template:Para The sidebar's name, i.e. the name following "Template:" in the title shown at the top of the sidebar's page.
Required if the Template:Small Template:Tl links at the bottom of the sidebar are to function correctly, unless their appearance is suppressed (see the navbar parameter below) or Template:Tlf is not being used as a wrapper for Module:Sidebar. When Template:Tlf is used as a wrapper, setting Template:Para is recommended.
Template:Para Use to place a title for the sidebar immediately above the sidebar.
Template:Para Use to place an image at the top of the sidebar, i.e. above Template:Para (if used). Full wiki syntax is expected (i.e. [[File:...]]).
To add a caption below the image, use Template:Para.
Template:Para Use to place a line such as "Part of the X series on" before the title.
Template:Para Use to place a title for the sidebar at the top of the sidebar. (If Template:Para is used, it will appear immediately below it).
Template:Para Use to place an image between the Template:Para (if used) and first section. As with Template:Para, full wiki syntax is expected (i.e. [[File:...]]).
To add a caption below the image, use Template:Para.
Template:Para Use to alter the default CSS styling set for section headings.
To alter the CSS styling for a specific section's heading, use Template:Para, where n is the number of the section.
Template:Para Use to alter the default CSS styling set for section content.
To alter the CSS styling for a particular section's content, use Template:Para, where n is the number of the section.
Template:Para
Template:Para
First section's headingTemplate:\content. content1 is required if heading1 is also to appear.
Template:Para
Template:Para
Second section's headingTemplate:\content. (content2 required if heading2 also to appear; etc.)
Template:Para
Template:Para
Third section's headingTemplate:\content.
...... etc ......
Template:Para
Template:Para
Currently, the last possible section heading and/or content.

Other parameters

Parameter Explanation
Template:Para Same as the Template:Para offered by Template:Tl.

Microformat classes for the corresponding parameters.
(Template:Para and Template:Para are applied across the whole sidebar.)

Template:Para Same as the Template:Para offered by Template:Tl.
(Use, for example, to add one or more portal links to the bottom of the template (shown, by default, in bold).)

Use to alter the default CSS styling for the corresponding parameters.
(Template:Para and Template:Para are applied across the whole sidebar.)

Template:Para
Template:Para
Use to amend the default cellspacingTemplate:\cellpadding set for the infobox-class table with which the sidebar is built.
Template:Longitem Set to "off", "none", etc. (without quotes) to remove the Template:Tl links (Template:Small) that otherwise appear at the bottom of the sidebar.
Template:Longitem Use to specify the font style used by the navbar at the bottom of the sidebar (see Template:Tl for options available).

Parameters

The topmost parameters (including name, outertitle, topimage, pretitle, title, image, headingstyle, contentstyle) are described at Template:Tl. Other Template:Tlf parameters not shown here (e.g. navbar) may also be used.

expanded Template:Nobold listNname
expanded is used to indicate which (if any) list named listNname is shown expanded when the template is first displayed; see Template:Tl.
listtitlestyle Template:Nobold liststyle
These are the equivalent of, respectively, Template:Tl's titlestyle and liststyle parameters.

Script error Any listN used without an accompanying listNtitle is still presented as a collapsible list under Template:Tlf's default title ("List"); see example opposite. Template:Smaller

Other parameters

In addition to the above, the following collapsible list-related parameters are also available:

listframestyle  
Sets the framestyle (see Template:Tl) for the lists.
listNframestyle 
Sets the framestyle for listN, overriding listframestyle.
listNtitlestyle 
Sets the titlestyle for listN, overriding listtitlestyle above.
listNstyle  
Sets the liststyle for listN, overriding liststyle above.

Handling long links

As with the sidebar template, Template:Tl may be used to handle links that should wrap within the sidebar or otherwise need to be made to wrap, in order to prevent the sidebar from becoming too wide. Use Template:Tlx, where Template:Para is the long link without its square brackets.

Use the Template:Para parameter to turn link wrapping off for the whole template.

Examples

Examples of this template can be found by checking the template's backlinks with What links here.

Handling long links

Template:Tl may be used to handle links that should wrap within the sidebar or otherwise need to be made to wrap, in order to prevent the sidebar from becoming too wide. Use Template:Tlx, where Template:Para is the long link without its square brackets.

Use the Template:Para parameter to turn link wrapping off for the whole template.

Embedding

One sidebar template can be embedded into another using the Template:Para parameter. This feature can be used to create a modular sidebar, or to create more well-defined and logical sections.

<tr><th style="padding:0.1em;"> Heading 1.1</th></tr><tr><td style="padding:0 0.1em 0.4em;"> Content 1.1</td> </tr></td> </tr><tr><td style="padding:0 0.1em 0.4em;"> Second subsection</th></tr><tr><th style="padding:0.1em;"> Heading 2.1</th></tr><tr><td style="padding:0 0.1em 0.4em;"> Content 2.1</td> </tr></td> </tr><tr><td style="padding:0.3em 0.4em 0.3em;font-weight:bold;"> "below" text</td></tr></table>
{{Sidebar
| title = Top-level title
| content1 =
 {{Sidebar |child=yes
  | title = First subsection
  | heading1 = Heading 1.1
  | content1 = Content 1.1
 }}
| content2 =
 {{Sidebar |child=yes
  | title = Second subsection
  | heading1 = Heading 2.1
  | content1 = Content 2.1
 }}
| below = "below" text
}}

Note in the examples above that the child sidebar is placed in a Template:Code field, not a Template:Code field. Notice also that the section subheadings do not appear in bold if this is not explicitly specified. To obtain bold section headings, place the child sidebar in a Template:Code field, using either:

</th></tr></th></tr>
{{Sidebar
| title = Top-level title
| heading1 =
 {{Sidebar |child=yes
  | title = First subsection
  | heading1 = Heading 1.1
  | content1 = Content 1.1
 }}
| heading2 =
 {{Sidebar |child=yes
  | title = Second subsection
  | heading1 = Heading 2.1
  | content1 = Content 2.1
 }}
| below = "below" text
}}

or:

</th></tr></th></tr>
{{Sidebar
| title = Top-level title
| heading1 = First subsection
 {{Sidebar |child=yes
  | heading1 = Heading 1.1
  | content1 = Content 1.1
 }}
| heading2 = Second subsection
 {{Sidebar |child=yes
  | heading1 = Heading 2.1
  | content1 = Content 2.1
 }}
| below = "below" text
}}

Note that omitting the Template:Para parameter and not including any text preceding the embedded sidebar may result in the creation of gaps by spurious blank rows.

Full blank syntax

Template:Generic template demo

(omitting heading4/content4 to penultimate heading/content parameters)

{{Sidebar
| name = {{subst:PAGENAME}}
| class =            <!-- or: | bodyclass = -->
| style =            <!-- or: | bodystyle = -->
| width = 
| cellspacing = 
| cellpadding = 
| wraplinks =        <!-- "true" otherwise (default:) omit -->

| outertitleclass = 
| outertitlestyle = 
| outertitle = 

| topimageclass = 
| topimagestyle = 
| topimage = 
| topcaptionstyle = 
| topcaption = 

| pretitleclass = 
| pretitlestyle = 
| pretitle = 

| titleclass = 
| title = 

| imageclass = 
| imagestyle = 
| image = 
| captionstyle = 
| caption = 

| headingclass = 
| headingstyle = 
| contentclass = 
| contentstyle = 

| aboveclass = 
| abovestyle = 
| above = 

| heading1style = 
| heading1 = 
| content1style = 
| content1 = 

| heading2style = 
| heading2 = 
| content2style = 
| content2 = 

| heading3style = 
| heading3 = 
| content3style = 
| content3 = 

<!-- etc, to: -->

| heading35style = 
| heading35 = 
| content35style = 
| content35 = 

| belowclass = 
| belowstyle = 
| below = 

| navbarstyle =      <!-- or: | tnavbarstyle = -->
| navbarfontstyle =  <!-- or: | tnavbarfontstyle = -->
| navbar =           <!-- or: | tnavbar = --> <!-- "off", "none", etc otherwise (default:) omit -->

}}

Supplementary documentation

Supplementary related documentation (concerning Template:Tl use within a sidebar) is at Template:Navbar/doc.

See also


Community content is available under CC-BY-SA unless otherwise noted.