Formula:Fnp

E Vicipaedia
Jump to navigation Jump to search

{{[[Template:{{{1}}}|{{{1}}}]]}}

Documentation icon Documentatio formulae[considerabit] [recense] [historia]

This is the template link with parameters (or {{fnp}}) template.

It can be used in documentation and talk page discussions to show how a template name would be used in code.

Here is how this template looks. Code to the left and actual rendering to the right:

{{fnp|name|parameters}} = {{name|parameters}}

Features of {{fnp}}:

  • It shows a template name with a link to that template.
  • It shows up to eight parameters.
  • It also shows empty parameters. (See examples below.)
  • It prevents line wraps in its output.
  • It uses normal text style.

Examples[fontem recensere]

Code Output Comments
{{fnp}} {{[[Template:{{{1}}}|{{{1}}}]]}} Shows its own syntax.
{{fnp|name}} {{name}}
{{fnp|name|first}} {{name|first}}
{{fnp|name|first|last}} {{name|first|last}}
{{fnp|name|a|b|c|d|e|f|g|h|i|j}} {{name|a|b|c|d|e|f|g|h}} Shows up to eight parameters. The rest are dropped.
{{fnp|name||three|four}} {{name||three|four}} Also shows empty parameters.
{{fnp|name||three|}} {{name||three|}} Even shows empty parameters that come at the end.
{{fnp|name|first=a|last=b}} {{name}} Equal signs are a problem, but there are a couple ways to fix:
{{fnp|name|2=first=a|3=last=b}} {{name|first=a|last=b}} Use numbered parameters to fix it. Here, parameter "|2=" is assigned the string "first=a". Start with #2, since "name" is already in the "|1=" slot. Note that all subsequent parameters after a numbered parameter must also be numbered.
{{fnp|name|first{{=}}a|last{{=}}b}} {{name|first=a|last=b}} Or, simply use, "{{=}}", the equal-sign template, to "escape" the symbol.
{{fnp|name|2=1=a|3=2=b}} {{name|1=a|2=b}} Both techniques also work with numbered positional parameters (e.g.: "|1=", "|2=").
{{fnp|name|2=1=a|last{{=}}b}} {{name|last=b}} The named parameter ("|last=") clobbered the prior one ("|2="). Again, all subsequent parameters after a numbered parameter must also be numbered...
{{fnp|name|2=1=a|3=last=b}} {{name|1=a|last=b}} ... but that's easy to fix, by adding the position number ("|3=") to the last parameter.

Nexus interni