Jump to content

Examples/Parameter: include (example 4)

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 lists pages in category Fruit examples and uses include to include from the Fruit-Infobox template, the variable for page title (%TITLE%), and the "image" and "grows" parameter values. In the table statement, the first argument adds CSS classes to the table, the second "-" deliberately omits the (automatic) linked page name from the first column, and the rest specify column headings.

The tablerow parameter essentially allows the values it holds to be precisely positioned within any formatting applied; the %TITLE% (first) value of the include is carried down to the first column by specifying %% in first position of the tablerow statement. The title is then wrapped in a <span></span> with formatting to make it italic. The next argument carried down is the "image" value (using %%) adding content before and after to format it as a rendered image at 30 pixels wide. The last tablerow argument %% displays the results of the "grows" parameter, this time without added formatting.

Important notes:

  • The include and tablerow parameters work together as a pair (table also).
  • The tablerow parameter essentially allows values to be precisely positioned within any basic formatting it applies.
  • Using %% caries down each value from the include statement, to the same position in the tablerow statement, though this is affected by the automatic creation of a first column containing linked page name (which we've used - in second position of the table statement to suppress).


Code
{{#dpl:
|category = Fruit examples
|include  = {Fruit-Infobox}:%TITLE%:image:grows
|table    = class="wikitable sortable",-,Page Name, Image, Grows
|tablerow = <span style="font-style: italic;">%%</span>,[[File:%%|30px]],%% 
|count    = 5
}}
Result
Page Name Image Grows
Apple On trees
Grape On vines
Orange On trees
Plum
Banana On a tree-like plant
Cookies help us deliver our services. By using our services, you agree to our use of cookies.