Jump to content

Template:DPL parameter.surrogateexample/doc

From DynamicPageList3 Manual
Documentation subpage
View this documentation's related template:
Template:DPL parameter.surrogateexample (edit).
Template styles: CSS styles (edit).

Example(s)

[edit source]
The following
  • {{DPL parameter.surrogateexample|name=debug|purpose=Some purpose text.}}
Gives

debug |Some purpose text.

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 the ParserFunctions extension, and it requires $wgPFEnableStringFunctions to be set to "true" (enabled) in order to function correctly; on Miraheze, ParserFunctions is already installed and the latter setting can be found and enabled in ManageWiki. The #sub parser function, used to add the "more..." text in this example, is for demonstration purposes only; it may break nowiki or other tags (creating undesired results) if it splits a result in the middle of one of such tags.

See Also

[edit source]
  • {{DPL parameter}}, the primary template that uses this one to format rows of output.

Documentation

[edit source]

This is a surrogate (also called a 'phantom') template that formats one result/line of output. It is then re-applied to subsequent rows. Surrogate/phantom templates are used by setting the template name in <code>includepage = {templatename}.suffix</code> (changing the suffix to whatever the template name is, usually the suffix is descriptive of template purpose).

Template parameters

ParameterDescriptionTypeStatus
namename

Enter the parameter name.

Stringrequired
purposepurpose

Enter the parameter description.

Stringrequired
Cookies help us deliver our services. By using our services, you agree to our use of cookies.