Examples/Parameter: include (example 6): Difference between revisions

From DynamicPageList3 Manual
imported>FrozenPlum
(fix my wrong category)
imported>FrozenPlum
m (FrozenPlum moved page Controlling output volume/Parameter: include (example 6) to Examples/Parameter: include (example 6): Simplifying how things are structured)
 
(No difference)

Latest revision as of 01:13, 1 April 2023

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 the Examples page, and includes all DPL3 parser function calls {{#dpl:}} used on that page. The parameters of each #dpl statement used on Examples are passed to, and can be used in, a surrogate template. The surrogate template specified ends in the chosen ".examples" suffix, resulting in: Template:dpl.examples; that surrogate only makes use of the {{{category|}}} and {{{ordermethod|}}} parameters, to pass those parameter's values to the output. The table statement applies default table formatting in the first argument (left empty, defaults to class="wikitable"), the second, third, and fourth arguments set the table header text. Since {{#dpl:}} was used more than once on the Examples page, one line of output for each instance appears (and table format separates these per line with a repeating title, where other formats may list the title once and the values thereafter).

{{#dpl:
|title = Examples
|include = {#dpl}.examples
|table = ,Page,<code>category</code> parameter value, <code>ordermethod</code> parameter value
}}

Result

{{#dpl: |title = Examples |include = {#dpl}.examples |table = ,Page,category parameter value, ordermethod parameter value }}