Examples/Parameter: multisecseparators (example 3): Difference between revisions

From DynamicPageList3 Manual
imported>FrozenPlum
m (Moving away from "phantom" use because phantom suggests something that is not there/imaginary, where surrogate is the more accurate term, it caries, substitutes, and also formats the results.)
imported>FrozenPlum
(No difference)

Revision as of 23:51, 31 March 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 example uses a surrogate (also known as phantom) template to format the second and third column of results. The first column is included in the listseparators statement, to prevent the page name from being repeated in every subsequent line. The second and third column, formatted in the surrogate, creates a link to the page's parameter name section, and then display the "purpose" text using Parser Functions. This combination of formatting the page name in a "separators" format statement and a surrogate template, results in templates used multiple times on a page to be separated into separate table rows under the parent page name (normally repeat templates used on a page are combined into a single row). This example is advanced, for more simple examples of surrogate template use see the include parameter as related to including contents from templates, see the table and tablerow parameters for straightforward table examples.

{{#dpl:
|category           = Primary Module
|nottitlematch	    = %volume%¦%page selection%
|uses               = Template:DPL Parameter
|include            = {dpl manual}:,{DPL parameter}.surrogateexample
|mode               = userformat
|listseparators     = ¶{¦class="wikitable sortable" ¶!colspan=3¦Includes a surrogate (phantom) template¶¦-¶!Page ¶!Name ¶!Purpose,¶¦-¶¦[[%PAGE%]]¶,¶¦-¶¦class="dpl-dark-background" colspan=3¦,¶¦}
|secseparators      = ,¶¦class="dpl-orange-background"¦,
|multisecseparators = ,¶¦-¶¦¶¦class="dpl-blue-background"¦
}}

Result

{{#dpl: |category = Primary Module |nottitlematch = %volume%¦%page selection% |uses = Template:DPL Parameter |include = {dpl manual}:,{DPL parameter}.surrogateexample |mode = userformat |listseparators = ¶{¦class="wikitable sortable" ¶!colspan=3¦Includes a surrogate (phantom) template¶¦-¶!Page ¶!Name ¶!Purpose,¶¦-¶¦%PAGE%¶,¶¦-¶¦class="dpl-dark-background" colspan=3¦,¶¦} |secseparators = ,¶¦class="dpl-orange-background"¦, |multisecseparators = ,¶¦-¶¦¶¦class="dpl-blue-background"¦ }}