Template:Sidebar/doc: Difference between revisions

From Xenharmonic Wiki
Jump to navigation Jump to search
Ganaram inukshuk (talk | contribs)
Created page with "{{dochead}}{{wikipedia}}{{lua}} '''Template:Sidebar''' is intended as a meta-template (a template used to construct other templates), used to build simple infoboxes and information-containing panels. Note that the infobox and sidebar are two different styles, and that the sidebar only supports one column, not two. == Parameters == ; <code>Title</code> (recommended) : The title to display. ; <code>Header Row</code> and <code>Footer Row</code> (op..."
 
Ganaram inukshuk (talk | contribs)
No edit summary
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{dochead}}{{wikipedia}}{{lua}}
{{dochead|header=metatemplate}}{{wikipedia}}
'''Template:Sidebar''' is intended as a meta-template (a template used to construct other templates), used to build simple infoboxes and information-containing panels.
'''Template:Sidebar''' is intended as a meta-template (a template used to construct other templates), used to build simple infoboxes and information-containing panels.


Line 5: Line 5:


== Parameters ==
== Parameters ==
; <code>Title</code> (recommended)
; <code>Title</code> (recommended; default <code>Sidebar Title</code>)
: The title to display.
: The title to display.


Line 11: Line 11:
: Content to display in a header and/or footer row.
: Content to display in a header and/or footer row.


; <code>Row N</code> (optional)
; <code>Row ''N''</code> (optional)
: Text for a single row. Up to 20 rows are supported using the template.
: Text for a single row. Up to 20 rows are supported using the template.
; <code>float</code> (optional; default <code>right</code>)
: Determines where on the page the sidebar goes, such as left or right.
; <code>name</code> (optional)
: The template's name, needed to create its view/talk/edit links.
== Basic usage ==
Rows in a sidebar can be added by adding parameters <code>Row ''N''</code>. Up to 20 rows can be added.
An optional <code>Header Row</code> and <code>Footer Row</code> may also be added. Sidebars that display complex information may have its template name passed into itself to provide navbar links.
{{Sidebar
| Title = Part of a series on Erv Wilson
| Row 1 = '''Scales'''<br />[[mos | Moment of symmetry scales]]<br />[[Combination product sets]]
| Row 2 = '''Concepts'''<br />[[Constant structure]]<br />[[Diaphonic cycle]]
| Footer Row = [[:Category:Erv Wilson | Category]]
| name = Sidebar Erv Wilson
}}
<pre>{{Sidebar
| Title = Part of a series on Erv Wilson
| Row 1 = '''Scales'''<br />[[mos | Moment of symmetry scales]]<br />[[Combination product sets]]
| Row 2 = '''Concepts'''<br />[[Constant structure]]<br />[[Diaphonic cycle]]
| Footer Row = [[:Category:Erv Wilson | Category]]
| name = Sidebar Erv Wilson
}}</pre>
{{clear}}
== Advanced usage ==
=== Using numlinks ===
The templates [[Template:numlinks]] and [[Template:numlinks 2-num]] may be used to automatically generate links for numbered pages. These templates may be placed in a <code>Row</code> or as the <code>Title</code>. This allows for the creation of simple infoboxes, without requiring the two-column nature of [[Template:Infobox]].
{{Sidebar
| Title = Fractional-octave temperaments
| Header Row = <hr>
| Row 1 =
  {{Numlinks
  | Current Num = 19
  | Link Format = %s-octave temperaments
  | Display Format = %s-octave
  | Current Page Format = %s-octave
  | Is Ordinal = 1
  | Is Table = false}}
}}
<pre>{{Sidebar
| Title = Fractional-octave temperaments
| Header Row = <hr>
| Row 1 =
  {{Numlinks
  | Current Num = 19
  | Link Format = %s-octave temperaments
  | Display Format = %s-octave
  | Current Page Format = %s-octave
  | Is Ordinal = 1
  | Is Table = false}}
}}</pre>
{{clear}}
=== Left-side sidebars ===
Unlike [[Template:Infobox]], the sidebar can be placed on the left side of a page.
{{Sidebar
| Title = Major second
| Header Row = <hr>
| Row 1 = &uarr; Minor 3rd
| Row 2 = <div style="font-size:80%;">&uarr; Supermajor 2nd</div>
| Row 3 = <div style="font-size:80%;">&darr; Neutral 2nd</div>
| Row 4 = &darr; Minor 2nd
| float = left
}}
{{clear}}
<pre>{{Sidebar
| Title = Major second
| Header Row = <hr>
| Row 1 = &uarr; Minor 3rd
| Row 2 = <div style="font-size:80%;">&uarr; Supermajor 2nd</div>
| Row 3 = <div style="font-size:80%;">duarr; Neutral 2nd</div>
| Row 4 = &darr; Minor 2nd
| float = left
}}</pre>
{{clear}}
== See also ==
* [[:Category:Infoboxes]], some of which use this template
* [[Template:Infobox]], a similar template that for displaying information that requires two columns

Latest revision as of 06:36, 31 October 2025

This template is a metatemplate. It is used to build other templates and should not be used standalone, except for testing or simple usage. This template is implemented by the Lua module Module:Sidebar.
This template invokes the following functions: sidebar from Sidebar.
English Wikipedia has an article on:

Template:Sidebar is intended as a meta-template (a template used to construct other templates), used to build simple infoboxes and information-containing panels.

Note that the infobox and sidebar are two different styles, and that the sidebar only supports one column, not two.

Parameters

Title (recommended; default Sidebar Title)
The title to display.
Header Row and Footer Row (optional)
Content to display in a header and/or footer row.
Row N (optional)
Text for a single row. Up to 20 rows are supported using the template.
float (optional; default right)
Determines where on the page the sidebar goes, such as left or right.
name (optional)
The template's name, needed to create its view/talk/edit links.

Basic usage

Rows in a sidebar can be added by adding parameters Row N. Up to 20 rows can be added.

An optional Header Row and Footer Row may also be added. Sidebars that display complex information may have its template name passed into itself to provide navbar links.

{{Sidebar
| Title = Part of a series on Erv Wilson
| Row 1 = '''Scales'''<br />[[mos | Moment of symmetry scales]]<br />[[Combination product sets]]
| Row 2 = '''Concepts'''<br />[[Constant structure]]<br />[[Diaphonic cycle]]
| Footer Row = [[:Category:Erv Wilson | Category]]
| name = Sidebar Erv Wilson
}}

Advanced usage

Using numlinks

The templates Template:numlinks and Template:numlinks 2-num may be used to automatically generate links for numbered pages. These templates may be placed in a Row or as the Title. This allows for the creation of simple infoboxes, without requiring the two-column nature of Template:Infobox.

Fractional-octave temperaments

← 18th-octave • 19th-octave • 20th-octave →
{{Sidebar
| Title = Fractional-octave temperaments
| Header Row = <hr>
| Row 1 = 
  {{Numlinks
  | Current Num = 19
  | Link Format = %s-octave temperaments
  | Display Format = %s-octave
  | Current Page Format = %s-octave
  | Is Ordinal = 1
  | Is Table = false}}
}}

Left-side sidebars

Unlike Template:Infobox, the sidebar can be placed on the left side of a page.

Major second

↑ Minor 3rd
↑ Supermajor 2nd
↓ Neutral 2nd
↓ Minor 2nd
{{Sidebar
| Title = Major second
| Header Row = <hr>
| Row 1 = ↑ Minor 3rd
| Row 2 = <div style="font-size:80%;">↑ Supermajor 2nd</div>
| Row 3 = <div style="font-size:80%;">duarr; Neutral 2nd</div>
| Row 4 = ↓ Minor 2nd
| float = left
}}

See also