Jump to content

Examples/Parameter: table (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

[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
Grapes on White Table.jpeg Grape On vines
Orange, orange peel.jpg Orange On trees
Plum on tree.jpg Plum
Banana-Single.jpg Banana On a tree-like plant
Cookies help us deliver our services. By using our services, you agree to our use of cookies.