Examples/Parameter: tablerow (example 2)

From DynamicPageList3 Manual
Please do not edit this page unless you're wanting to edit the manual itself, it is an example included in the manual.

Example

This selects articles from Category:Fruit examples, it then includes: the "Fruit-Infobox" template's "grows" parameter value, in first column, the full page name (including namespace) in the second, an intentionally blank/null parameter name in the third (to hold position for the next parameter), and finally includes the image (name) as the last parameter value to include. The table statement's first argument sets table's styles, the second suppresses the otherwise automatic lined page/title in the table's first column, then specifies the titles text for the 4 columns.

The tablerow statement sets a {{#vardefine:page_}}{{#vardefine:page| }}[[{{#var:page}}|#dplvar]] (variable) named "varGrows", and specifies its corresponding include value ("grows") using %%; and, as setting a variable doesn't also display that variable, %% is used again in that column to display it. Next, the page/title is linked to and set to italic, followed by repeating the value of column 1 in column 3 by calling it by variable name; that was done because the values otherwise cannot be used in columns outside the column order set in include statement, where setting the variable in the first column enables its use in the third column. Finally, the image (name) value %% is displayed in the fourth (last) column.

{{#dpl:
|category      = Fruit examples
|include       = {Fruit-Infobox}:grows:%PAGE%:<!--blank-->:image
|table         = class="wikitable mw-collapsible",-,1st col,2nd col,3rd col,4th col
|tablerow      = ²{#dplvar:set¦varGrows¦%%}²%%,<i>[[%PAGE%|%TITLE%]]</i>,²{#dplvar:varGrows}²,%%
|count         = 5
}}

Result

{{#dpl: |category = Fruit examples |include = {Fruit-Infobox}:grows:%PAGE%::image |table = class="wikitable mw-collapsible",-,1st col,2nd col,3rd col,4th col |tablerow = ²{#dplvar:set¦varGrows¦%%}²%%,%TITLE%, ²{#dplvar:varGrows}²,%% |count = 5 }}