Template:DPL parameter.surrogateexample: Difference between revisions

From DynamicPageList3 Manual
Content added Content deleted
imported>FrozenPlum
mNo edit summary
imported>FrozenPlum
mNo edit summary
Line 1: Line 1:
[[{{{%PAGE%}}}#{{{name}}}|{{{name}}}]]||{{#sub:{{{purpose|}}}|0|50}} {{#ifeq: {{#expr: {{#len:{{{purpose|}}}}} > 50}} }} | yes | [[{{{%PAGE%}}}#{{{name}}}|more ...]] | }}<noinclude>
[[{{{%PAGE%}}}#{{{name}}}|{{{name}}}]]||{{#sub:{{{purpose|}}}|0|50}} {{#ifeq: {{#expr: {{#len:{{{purpose|}}}}} > 50}} | yes | [[{{{%PAGE%}}}#{{{name}}}|more ...]] | }}<noinclude>


<!-- Documentation here -->
<!-- Documentation here -->

Revision as of 21:34, 11 April 2022

[[{{{%PAGE%}}}#{{{name}}}|{{{name}}}]]||{{#sub:|0|50}}

View this page's source to see each of the columns it creates in the table it is used in (it formats the second and the third column of results) used in only Parameter: multisecseparators (example 3).


This template is a surrogate template (also called a 'phantom template') that formats one result/line of DPL output. DPL then reuses and applies this surrogate template's formatting to each result/line in the output list.

Surrogate/phantom templates are used by setting the template name in includepage = {templatename}.suffix (changing the suffix to whatever the template name is, usually the suffix is descriptive of template purpose).

Naming the surrogate/phantom template after its parent, and then adding a descriptive suffix on the end, ensures both the parent and surrogate are easily found, and their relationship to each other easily understood. This style of naming them is particularly useful when looking at templates in Special:AllPages (and selecting the templates drop-down option).

This surrogate template requires that $wgPFEnableStringFunctions be set to "true" (enabled) in order to function correctly; on Miraheze, this is a setting that can be found and enabled in ManageWiki.