Template:DPL parameter.surrogateexample

Template documentation
Note: portions of the template sample may not be visible without values provided.
View or edit this template's documentation (edit) (about template documentation).
No TemplateStyles exist (create). Remember to add after the opening <includeonly> tag:
<templatestyles src="Template:DPL parameter.surrogateexample/styles.css" />


Example(s)

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

debug |Some purpose text.

Notes

edit

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
  • {{DPL parameter}}, the primary template that uses this one to format rows of output.

Documentation

edit

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[Edit template data]

ParameterDescriptionTypeStatus
namename

Enter the parameter name.

Stringrequired
purposepurpose

Enter the parameter description.

Stringrequired