Template:Infobox/doc: Difference between revisions

Ganaram inukshuk (talk | contribs)
No edit summary
Ganaram inukshuk (talk | contribs)
No edit summary
 
(33 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{dochead | header = metatemplate }}
{{wikipedia}}
'''{{ARTICLEROOTPAGENAME}}''' is intended as a meta-template (i.e. a template intended mainly for constructing other templates). Although using [[Module:Infobox]] directly is the primary way to create infoboxes (such as those that automatically add entries), this template can be used standalone, such as with prototyping or making simple infoboxes. See [[:Category:Infoboxes]] to see all templates that generate infoboxes.{{clear}}
== Parameters ==
; <code>Title</code> (recommended; default <code>Infobox Title</code>)
: The title text.
; <code>''Direction'' Link</code> (optional)
: A link to the next or previous page, if the page is part of a series of related pages. <code>''Direction''</code> can be any of the following: Upper Left, Upper, Upper Right, Left, Right, Lower Left, Lower, Lower Right.
; <code>Header Row</code> (optional) and <code>Footer Row</code> (optional)
: Text for an infobox's header and footer rows, respectively.
; <code>Header ''N''</code> (recommended) and <code>Data ''N''</code> (recommended)
: Text for a row's header cell and data cell. A row's header cell may be omitted for simple infoboxes. Up to 30 rows are supported using the template.
; <code>name</code> (optional)
: The template's name, needed to create its view/talk/edit links.
== Usage ==
== Usage ==
=== Basic usage ===
 
Rows in an infobox can be added by adding parameters <code><nowiki>Header N</nowiki></code> and <code><nowiki>Row N</nowiki></code>. Up to 30 rows can be added, each with a separate header and data entry.
=== Infobox rows ===
Rows in an infobox can be added by adding parameters <code>Header ''N''</code> and <code>Row ''N''</code>. Up to 30 rows can be added, each with a separate header and data entry.
 
An optional <code>Header Row</code> and <code>Footer Row</code> may also be added. Infoboxes that display complex information may have its template name passed into itself to provide navbar links.


{{Infobox
{{Infobox
|Title=3/2
| Title=3/2
|Header 1 = Size in cents
| Header Row = <hr>
|Data 1 = 701.9¢
| Header 1 = Size in cents
|Header 2 = Common name(s)
| Data 1 = 701.9¢
|Data 2 = Just perfect 5th
| Header 2 = Common name(s)
|Header 3 = Harmonic entropy
| Data 2 = Just perfect 5th
|Data 3 = 3.42385 bits
| Header 3 = Harmonic entropy
| Data 3 = 3.42385 bits
| Footer Row = Listen on Xencalc
| name = Infobox example
}}
}}


<pre>{{Infobox
<pre>{{Infobox
|Title=3/2
| Title=3/2
|Header 1 = Size in cents
| Header Row = <hr>
|Data 1 = 701.9¢
| Header 1 = Size in cents
|Header 2 = Common name(s)
| Data 1 = 701.9¢
|Data 2 = Just perfect 5th
| Header 2 = Common name(s)
|Header 3 = Harmonic entropy
| Data 2 = Just perfect 5th
|Data 3 = 3.42385 bits
| Header 3 = Harmonic entropy
| Data 3 = 3.42385 bits
| Footer Row = Listen on Xencalc
| name = Infobox example
}}</pre>
}}</pre>


{{clear}}
{{clear}}


=== Left and right links ===
=== Navigation links ===
Basic navigation can be added by including <code><nowiki>Left Link</nowiki></code> and <code><nowiki>Right Link</nowiki></code>. Links may be omitted, such as with border cases.


Basic navigation can be added by including <code><nowiki>Left Link</nowiki></code> and <code><nowiki>Right Link</nowiki></code>.
Note that links are ''not'' automatically formatted; to link to the pages, brackets <code><nowiki>[[  ]]</nowiki></code> must be added.


{{Infobox
{{Infobox
|Title=12edo
| Title=12edo
|Header 1 = Size of fifth
| Header 1 = Size of fifth
|Data 1 = 700¢
| Data 1 = 700¢
|Header 2 = Size of step
| Header 2 = Size of step
|Data 2 = 100¢
| Data 2 = 100¢
|Left Link = &larr; 11edo
| Left Link = &larr; 11edo
|Right Link = 13edo &rarr;
| Right Link = 13edo &rarr;
}}
}}


Note that links are ''not'' automatically formatted.
<pre>{{Infobox
<pre>{{Infobox
|Title=12edo
| Title=12edo
|Header 1 = Size of fifth
| Header 1 = Size of fifth
|Data 1 = 700¢
| Data 1 = 700¢
|Header 2 = Size of step
| Header 2 = Size of step
|Data 2 = 100¢
| Data 2 = 100¢
|Left Link = &larr; 11edo
| Left Link = &larr; 11edo
|Right Link = 13edo &rarr;
| Right Link = 13edo &rarr;
}}</pre>
}}</pre>


{{Clear}}
{{Clear}}


=== Omitting links ===
For pages that have two varying values, the following links may also be added: <code><nowiki>Upper Left Link</nowiki></code>, <code><nowiki>Upper Link</nowiki></code>, <code><nowiki>Upper Right Link</nowiki></code>, <code><nowiki>Lower Left Link</nowiki></code>, <code><nowiki>Lower Link</nowiki></code>, and <code><nowiki>Lower Right Link</nowiki></code>. As with the left and right links, any of these links can be omitted, such as with border cases.


Links can be omitted, such as with border cases.
{{Clear}}
 
=== Headerless rows ===
A row that only contains a <code>Data ''N''</code> entry and no corresponding <code>Header ''N''</code> is interpreted as a headerless row. This can be used as separators for grouping related information or for information that does not require a header, such as external links.


{{Infobox
{{Infobox
|Title=Prime Limit 2
| Title=5L 2s
|Right Link = 3-limit &rarr;
| Data 1 = Generator information
| Header 2 = Bright gen
| Data 2 = 685.7¢ to 720¢
| Header 3 = Dark gen
| Data 3 = 480¢ to 514.3¢
| Data 4 = Tunings
| Header 5 = Hard tuning
| Data 5 = 17edo (gen = 705.9¢)
| Header 6 = Basic tuning
| Data 6 = 12edo (gen = 700¢)
| Header 7 = Soft tuning
| Data 7 = 19edo (gen = 694.7¢)
| Data 30 = Listen on Xenpaper
| Left Link = &larr; 5L 1s
| Right Link = 5L 3s &rarr;
| Upper Link = &uarr; 4L 2s
| Lower Link = &darr; 6L 2s
}}
}}


<pre>{{Infobox
<pre>{{Infobox
|Title=Prime Limit 2
| Title=5L 2s
|Right Link = 3-limit &rarr;
| Data 1 = Generator information
}}</pre>
| Header 2 = Bright gen
| Data 2 = 685.7¢ to 720¢
| Header 3 = Dark gen
| Data 3 = 480¢ to 514.3¢
| Data 4 = Tunings
| Header 5 = Hard tuning
| Data 5 = 17edo (gen = 705.9¢)
| Header 6 = Basic tuning
| Data 6 = 12edo (gen = 700¢)
| Header 7 = Soft tuning
| Data 7 = 19edo (gen = 694.7¢)
| Data 30 = Listen on Xenpaper
| Left Link = &larr; 5L 1s
| Right Link = 5L 3s &rarr;
| Upper Link = &uarr; 4L 2s
| Lower Link = &darr; 6L 2s
}}</pre>{{clear}}


{{Clear}}
== Advanced usage ==


=== Upper and lower links ===
=== Using numlinks ===


Additional navigation can be added by including any of the following: <code><nowiki>Upper Left Link</nowiki></code>, <code><nowiki>Upper Link</nowiki></code>, <code><nowiki>Upper Right Link</nowiki></code>, <code><nowiki>Lower Left Link</nowiki></code>, <code><nowiki>Lower Link</nowiki></code>, and <code><nowiki>Lower Right Link</nowiki></code>. As with the left and right links, links can be omitted.
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>Data</code> row or as the <code>Title</code>.


{{Infobox
{{Infobox
|Title=5L 2s
| Title = Fractional-octave temperaments
|Header 1 = Generator
| Header Row = <hr>
|Data 1 = 685.7¢ to 720¢
| Data 1 =  
|Header 2 = Basic tuning
  {{Numlinks
|Data 2 = 12edo (gen = 700¢)
  | Current Num = 19
|Left Link = &larr; 5L 1s
  | Link Format = %s-octave temperaments
|Right Link = 5L 3s &rarr;
  | Display Format = %s-octave
|Upper Link = &uarr; 4L 2s
  | Current Page Format = %s-octave
|Lower Link = &darr; 6L 2s
  | Is Ordinal = 1
  | Is Table = false}}
}}
}}


<pre>{{Infobox
<pre>{{Infobox
|Title=5L 2s
| Title = Fractional-octave temperaments
|Header 1 = Generator
| Header Row = <hr>
|Data 1 = 685.7¢ to 720¢
| Data 1 =  
|Header 2 = Basic tuning
  {{Numlinks
|Data 2 = 12edo (gen = 700¢)
  | Current Num = 19
|Left Link = &larr; 5L 1s
  | Link Format = %s-octave temperaments
|Right Link = 5L 3s &rarr;
  | Display Format = %s-octave
|Upper Link = &uarr; 4L 2s
  | Current Page Format = %s-octave
|Lower Link = &darr; 6L 2s
  | Is Ordinal = 1
  | Is Table = false}}
}}</pre>
}}</pre>


{{Clear}}
{{clear}}
 
=== Headerless rows ===


A row that only contains a <code><nowiki>Data N</nowiki></code> entry and no corresponding <code><nowiki>Header N</nowiki></code> is interpreted as a headerless row. This can be used as separators for grouping related information or for information that does not require a header, such as external links.
These templates can be used as the infobox's <code>Title</code>, producing the same result as using the infobox's <code>Link</code> parameters. As such, the <code>Link</code> parameters must not be used at the same time as using the numlinks templates as the <code>Title</code>.


{{Infobox
{{Infobox
|Title=5L 2s
| Title =
|Data 1 = Generator information
  {{Numlinks 2-num
|Header 2 = Bright gen
  | Current Num 1 = 5
|Data 2 = 685.7¢ to 720¢
  | Current Num 2 = 12
|Header 3 = Dark gen
  | Link Format = %sL&nbsp;%ss}}
|Data 3 = 480¢ to 514.3¢
| Header 1 = '''Scale info'''
|Data 4 = Tunings
| Header 2 = Step Pattern
|Header 5 = Hard tuning
| Data 2 = LssLssLsssLssLsss
|Data 5 = 17edo (gen = 705.9¢)
|Header 6 = Basic tuning
|Data 6 = 12edo (gen = 700¢)
|Header 7 = Soft tuning
|Data 7 = 19edo (gen = 694.7¢)
|Data 30 = Listen on Xenpaper
|Left Link = &larr; 5L 1s
|Right Link = 5L 3s &rarr;
|Upper Link = &uarr; 4L 2s
|Lower Link = &darr; 6L 2s
}}
}}


<pre>{{Infobox
<pre>{{Infobox
|Title=5L 2s
| Title =
|Data 1 = Generator information
  {{Numlinks 2-num
|Header 2 = Bright gen
  | Current Num 1 = 5
|Data 2 = 685.7¢ to 720¢
  | Current Num 2 = 12
|Header 3 = Dark gen
  | Link Format = %sL&nbsp;%ss}}
|Data 3 = 480¢ to 514.3¢
| Header 1 = '''Scale info'''
|Data 4 = Tunings
| Header 2 = Step Pattern
|Header 5 = Hard tuning
| Data 2 = LssLssLsssLssLsss
|Data 5 = 17edo (gen = 705.9¢)
}}</pre>
|Header 6 = Basic tuning
|Data 6 = 12edo (gen = 700¢)
|Header 7 = Soft tuning
|Data 7 = 19edo (gen = 694.7¢)
|Data 30 = Listen on Xenpaper
|Left Link = &larr; 5L 1s
|Right Link = 5L 3s &rarr;
|Upper Link = &uarr; 4L 2s
|Lower Link = &darr; 6L 2s
}}}</pre>


{{Clear}}
{{clear}}


== See also ==


=== See also ===
* [[:Category:Infoboxes]], infoboxes, some of which use this template
* {{modlink}}
* [[Template:Navbox]], a similar metatemplate for navboxes
* [[Template:Sidebar]], a similar template that may be used for navboxes that doesn't require two columns