Template:Pp/doc

From FamilySearch Wiki
< Template:Pp
Revision as of 09:16, 28 April 2012 by Cottrells (talk | contribs) (Created page with "{{Documentation subpage}} This template contains <code><nowiki>{{{{{{1}}}}}}</nowiki></code>. If the first parameter is an integer > 1 this template corresponds to: <code><now...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This template contains {{{{{{1}}}}}}.

If the first parameter is an integer > 1 this template corresponds to:

{{p{{#expr:{{{1}}}-1}}|{{{2}}}|{{{3}}}|{{{4}}}|..}}

Apart from the fact that it does not trim the result it also corresponds to:

{{#switch:{{{1}}}|2={{{2}}}|3={{{3}}}|4={{{4}}}|..}}

or similar with other parameter names.

If lb is a lower bound on the values of {{{1}}} we can use {{pp|{{#expr:{{{1}}}+2-lb}}|fa|fb|..}}. This not only allows low values of {{{1}}} if the lower bound is less than 2, but it also reduces the parameter numbers if the lower bound is greater than 2. For example, if {{{1}}} is in the range 100-110 we can use unnamed parameters without specifying dummy values for the parameters 2-99: {{pp|{{#expr:{{{1}}}-98}}|f100|f101|..}}.

Usage

  • " [[Category:Templates]] [[Category:Templates]] [[Category:Templates]] [[Category:Templates]] [[Category:Templates]]{{pp|&s [[Category:Templates]]1&s [[Category:Templates]]|&s [[Category:Templates]]9 [[Category:Templates]]&s [[Category:Templates]]|&s [[Category:Templates]]7 [[Category:Templates]]&s [[Category:Templates]]}}" gives " 1 " [1]
  • " [[Category:Templates]] [[Category:Templates]] [[Category:Templates]] [[Category:Templates]] [[Category:Templates]]{{pp|&s [[Category:Templates]]2&s [[Category:Templates]]|&s [[Category:Templates]]9 [[Category:Templates]]&s [[Category:Templates]]|&s [[Category:Templates]]7 [[Category:Templates]]&s [[Category:Templates]]}}" gives " 9 " [2]
  • " [[Category:Templates]] [[Category:Templates]] [[Category:Templates]] [[Category:Templates]] [[Category:Templates]]{{pp|&s [[Category:Templates]]3&s [[Category:Templates]]|&s [[Category:Templates]]9 [[Category:Templates]]&s [[Category:Templates]]|&s [[Category:Templates]]7 [[Category:Templates]]&s [[Category:Templates]]}}" gives " 7 " [3]
  • "{{pp| a | a = 9 | b = 7 }}" gives "9"
  • "{{pp| b | a = 9 | b = 7 }}" gives "7"

Compare:

  • "{{p1|&s [[Category:Templates]]9 [[Category:Templates]]&s [[Category:Templates]]|&s [[Category:Templates]]7 [[Category:Templates]]&s [[Category:Templates]]}} [[Category:Templates]] [[Category:Templates]] [[Category:Templates]] [[Category:Templates]] [[Category:Templates]] [[Category:Templates]] [[Category:Templates]] [[Category:Templates]] [[Category:Templates]]" gives " 9 " [4]
  • "{{p2|&s [[Category:Templates]]9 [[Category:Templates]]&s [[Category:Templates]]|&s [[Category:Templates]]7 [[Category:Templates]]&s [[Category:Templates]]}} [[Category:Templates]] [[Category:Templates]] [[Category:Templates]] [[Category:Templates]] [[Category:Templates]] [[Category:Templates]] [[Category:Templates]] [[Category:Templates]] [[Category:Templates]]" gives " 7 " [5]
  • {{sw|2||2| 9 |3| 7 }} gives " 9 "
  • {{sw|3||2| 9 |3| 7 }} gives " 7 "

Trimming:

  • {{#switch:2|2= 9 |3= 7 }} gives "9"
  • {{#switch:3|2= 9 |3= 7 }} gives "7"
  • {{switch|2|case: 2= 9 |case: 3= 7 }} gives "9"
  • {{switch|3|case: 2= 9 |case: 3= 7 }} gives "7"