Jump to content

Examples/Parameter: table (example 2)

From DynamicPageList4 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

[edit source]

This selects pages in category Fruit examples and include the values of the {{Fruit-Infobox}} template's "image" and "grows" parameters, with the page title as a link in between the two template parameter values. The table statement sets its styles to "wikitable" and "sortable", then most importantly uses the - character in second position to suppress the automatic linked page name first column (so it can be moved to a different column). That same statement also sets the table header text. The list output count is limited to 5 results.

Note: In this case, the [[%PAGE%|%TITLE%]] formatting is applied directly in the include statement, where most other formatting (such as turning the image name into a rendered image) cannot be.

Code
{{#dpl:
|category = Fruit examples
|include  = {Fruit-Infobox}:image:[[%PAGE%|%TITLE%]]:grows
|table    = class="wikitable sortable",-, Image used on page, Page, Value of "grows" parameter
|count    = 5
}}
Result
Image used on page Page Value of "grows" parameter
Red Apple Fruit With Black Background.jpeg Apple On trees
Apricot_whole444.jpg Apricot On trees
Banana-Single.jpg Banana On a tree-like plant
Grapes on White Table.jpeg Grape On vines
Mango 2008-3-1.JPG Mango On trees
Cookies help us deliver our services. By using our services, you agree to our use of cookies.