Template:Conditional template call with newline/doc

From Wikipedia, the free encyclopedia

This is a documentation subpage for Template:Conditional template call with newline (see that page for the template itself).
It contains usage information, categories and other content that is not part of the original template page.

This template calls template {{{2}}} with parameter {{{3}}} and adds a newline, all under condition {{{1}}}. Successive calls should not be separated by a newline.

This templates avoids writing out the condition twice, once for the template call and once for the newline, see the end of the section m:Help:Table#Conditional table row.

[edit] Usage

Simple example:

{| class="wikitable sortable"
!Municipality!!Population
{{Conditional template call with newline|1|Table row Dutch municipality|Delft}}{{Conditional template call with newline|0|Table row Dutch municipality|Hoorn}}{{Conditional template call with newline|1|Table row Dutch municipality|Rotterdam}}|}

gives

Municipality Population
Delft e 95,237
Rotterdam e 581,615

The template is typically called by another table row template, which has as parameter {{{1}}} the identification of the potential item (in this template: {{{3}}}), and some parameter {{{2}}} related to the condition. That template provides the condition in terms of {{{1}}} and {{{2}}}.

Example: