Template:Infobox/doc: Difference between revisions
No edit summary |
|||
| (11 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
{{dochead}}{{ | {{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}} | '''{{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 == | == Parameters == | ||
; <code>Title</code> (recommended; default <code>Infobox Title</code>) | ; <code>Title</code> (recommended; default <code>Infobox Title</code>) | ||
| Line 19: | Line 17: | ||
: 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. | : 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 == | |||
=== Infobox rows === | === 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. | 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 | ||
| Line 34: | Line 37: | ||
| Data 3 = 3.42385 bits | | Data 3 = 3.42385 bits | ||
| Footer Row = Listen on Xencalc | | Footer Row = Listen on Xencalc | ||
| name = Infobox example | |||
}} | }} | ||
| Line 46: | Line 50: | ||
| Data 3 = 3.42385 bits | | Data 3 = 3.42385 bits | ||
| Footer Row = Listen on Xencalc | | Footer Row = Listen on Xencalc | ||
| name = Infobox example | |||
}}</pre> | }}</pre> | ||
{{clear}} | {{clear}} | ||
=== | === 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>. Links may be omitted, such as with border cases. | ||
| Line 81: | Line 86: | ||
{{Clear}} | {{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 | |||
| Title=5L 2s | |||
| 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 = ← 5L 1s | |||
| Right Link = 5L 3s → | |||
| Upper Link = ↑ 4L 2s | |||
| Lower Link = ↓ 6L 2s | |||
}} | |||
<pre>{{Infobox | |||
| Title=5L 2s | |||
| 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 = ← 5L 1s | |||
| Right Link = 5L 3s → | |||
| Upper Link = ↑ 4L 2s | |||
| Lower Link = ↓ 6L 2s | |||
}}</pre>{{clear}} | |||
== Advanced usage == | |||
The templates [[Template:numlinks]] and [[Template:numlinks 2-num]] may be used to automatically generate links for numbered pages. | === 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>Data</code> row or as the <code>Title</code>. | |||
{{Infobox | {{Infobox | ||
| Title = Fractional-octave temperaments | | Title = Fractional-octave temperaments | ||
| Header Row = <hr> | |||
| Data 1 = | | Data 1 = | ||
{{Numlinks | {{Numlinks | ||
| Line 99: | Line 152: | ||
<pre>{{Infobox | <pre>{{Infobox | ||
| Title = Fractional-octave temperaments | | Title = Fractional-octave temperaments | ||
| Header Row = <hr> | |||
| Data 1 = | | Data 1 = | ||
{{Numlinks | {{Numlinks | ||
| Line 111: | Line 165: | ||
{{clear}} | {{clear}} | ||
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 | ||
| Line 137: | Line 191: | ||
{{clear}} | {{clear}} | ||
=== | == See also == | ||
* [[:Category:Infoboxes]], infoboxes, some of which use this template | |||
* [[Template:Navbox]], a similar metatemplate for navboxes | |||
* [[Template:Sidebar]], a similar template that may be used for navboxes that doesn't require two columns | |||