Examples/Parameter: include (example 6)

From DynamicPageList3 Manual
Revision as of 09:09, 20 April 2022 by imported>FrozenPlum (Created page with "<noinclude>{{note|Please '''do not edit''' this page unless you're wanting to edit the manual itself, it is an example included in the manual.|error}}</noinclude><!-- This is the example preloaded for testing, press "Show Preview" to see the example working (at the bottom of the page). If you save this page, it saves as a new section at the bottom of your '''User:Username/Sandbox''' --> ==Example== This example selects the Examples page, and includes parser functio...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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 example selects the Examples page, and includes parser function calls {{#dpl:}} used on that "Examples" page, passing its parameters to a surrogate template called Template:dpl.examples. All #dpl parser function parameters used on the "Examples" page can be used/accessed inside that surrogate template, to display their values in the output, though only {{{category|}}} and {{{ordermethod|}}} were used to pass their values to the output below. The table statement uses default table formatting in the first (empty) argument, the second, third and fourth arguments set the table header text. Since the {{#dpl:}} parser function was used on the page more than once, and table format was used (in which row of output are separated with the titles repeating) the page column also repeats for each one (separation and repeating title would not be the case in some other output formats). A value is only displayed for cells that use the corresponding parameter, otherwise they'd appear empty.

{{#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 }}