Open main menu

Changes

Template:Infobox/doc

341 bytes added, 08:13, 13 June 2013
move the details on template limitations to its own section, add a plug for Module:IncrementParams
==== Number ranges ====
There is no limit on the number of rows available for use. To allow flexibility when the layout of an infobox is changed, it may be helpful when developing an infobox to use non-contiguous numbers for header and label/data rows. Parameters for new rows can then be inserted in future without having to renumber existing parameters. For example:
<pre>|header3 = Section 1
|label5 = Label A
|data12 = Data D</pre>
Although there It is no limitation on the ''number'' of rows, row parameters should not be numbered more than 50 apart. This is a limit imposed by the template also possible to ensure backwards compatibility with existing infoboxes. If parameters are numbered more than 50 apart, the later automatically renumber parameter may be ignored (depending on the exact numbers involved), and if parameters are numbered more than 100 apart, the later parameter will definitely be ignorednames by using [[Module:IncrementParams]].
For example, this code will display properly:<pre>|header3 = Section 1|label48 = Label A|data48 = Data A|data92 = Data B|label136 = Label C|data136 = Data C|header177 = Section 2|label215 = Label D|data215 = Data D</pre> But in this code, only Section 1, Label A and Data A will be displayed:<pre>|header3 = Section 1|label48 = Label A|data48 = Data A|data102 = Data B|label103 = Label C|data103 = Data C|header115 = Section 2|label120 = Label D|data120 = Data D</pre> Note that parameter values may be blank - parameters are counted unless they are completely absent from although there is no limitation on the template invocation. There are also similar limitations for image parameters and subheader parameters. In those cases number of rows available, row parameters should not be numbered more than 10 50 apart. See the [[#Limitations]] section below for more details.
=== Parameters ===
|below =
}}</pre>
 
=== Limitations ===
Previously, the number of rows available to this template was limited to 99. This restriction has been lifted now that the template has been ported to a [[WP:Lua|Lua module]], but to maintain backwards compatibility there is now a limit on the number of rows apart by which parameters will be detected. If parameters are numbered more than 50 apart, the later parameters may be ignored (depending on the exact numbers involved), and if parameters are numbered more than 100 apart, the later parameters will definitely be ignored.
 
For example, this code will display properly:
<pre>|header3 = Section 1
|label48 = Label A
|data48 = Data A
|data92 = Data B
|label136 = Label C
|data136 = Data C
|header177 = Section 2
|label215 = Label D
|data215 = Data D
</pre>
 
But in this code, only Section 1, Label A and Data A will be displayed:
<pre>|header3 = Section 1
|label48 = Label A
|data48 = Data A
|data102 = Data B
|label103 = Label C
|data103 = Data C
|header115 = Section 2
|label120 = Label D
|data120 = Data D
</pre>
 
Note that parameter values may be blank - parameters are counted unless they are completely absent from the template invocation. There are also similar limitations for image parameters and subheader parameters. In those cases parameters should not be numbered more than 10 apart.
=== Porting to other MediaWikis ===
Anonymous user