Examples/Parameter: table (example 3): Difference between revisions
< Examples
Content added Content deleted
imported>FrozenPlum m (FrozenPlum moved page Controlling output format/Parameter: table (example 1) to Controlling output format/Parameter: table (example 2) without leaving a redirect: Going to make a more simple first example to contrast between auto-first column and omitted first column) |
imported>FrozenPlum mNo edit summary |
||
Line 6:
==Example==
This
<pre>
{{#dpl:
|category
|include
|table
|count
}}
</pre>
Line 22 ⟶ 20:
{{#dpl:
|category
|include
|table
|count
}}
|
Revision as of 05:27, 16 April 2022
Example
This selects articles in Category:Fruit examples and uses a surrogate template to format the second and third columns of results (the first column is automatically generated and populated by DPL3 because the second table
value doesn't contain -
to intentionally omit this, instead it contains the first column's table header "Page", and then sets the rest of the table headers. If -
was in second position for table
, the first column would drop off and the page name would need to be added to the first row of the surrogate template, it could be called with {{{%PAGE%}}}
and formatted.
{{#dpl: |category = Fruit examples |include = {Fruit-Infobox}.templatevalues |table = class="wikitable sortable",Page,Grows,Image |count = 5 }}
Result
{{#dpl: |category = Fruit examples |include = {Fruit-Infobox}.templatevalues |table = class="wikitable sortable",Page,Grows,Image |count = 5 }}