Template:Numlinks/doc: Difference between revisions

Ganaram inukshuk (talk | contribs)
Ganaram inukshuk (talk | contribs)
mNo edit summary
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{dochead}}{{lua}}
{{dochead|header=metatemplate}}
'''Template:Numlinks''' is intended as a meta-template (a template used to construct other templates), used to build {{w|WP:NAV|navigational templates}}. This can be used directly, or by using its corresponding module, [[Module:Numlinks]].
'''Template:Numlinks''' is intended as a meta-template (a template used to construct other templates), used to build {{w|WP:NAV|navigational templates}}. This can be used directly, or by using its corresponding module, [[Module:Numlinks]].


Line 5: Line 5:


== Parameters ==
== Parameters ==
; <code>Current Num</code> (required)
; <code>Current Num</code> (required; default is the first number in the page's name)
: The current number of the page. May be obtained by using <code>#rmatch</code> or similar.
: The current number of the page. By default, this is the first occurrence of a number in the page's name; if this is the wrong number, it may be specified using <code>#rmatch</code> or entered manually.
 
; <code>Link Format</code> (required; default is the page's name)
: The text used for page links, as a format string. By default, this is the page's name, where the number is replaced with <code>%s</code>. If there are multiple numbers, or the number is an ordinal (1st, 2nd, etc), it's necessary to enter the format string manually to avoid issues.


; <code>Link Count</code> (optional; default <code>1</code>)
; <code>Link Count</code> (optional; default <code>1</code>)
Line 13: Line 16:
; <code>Min</code> (optional; default <code>1</code>)
; <code>Min</code> (optional; default <code>1</code>)
: The minimum valid value for page numbers.
: The minimum valid value for page numbers.
; <code>Link Format</code> (optional; default <code>%s</code>)
: The text used for page links, where <code>%s</code> denotes the page number.


; <code>Display Format</code> (optional; default is to use <code>Link Format</code>)
; <code>Display Format</code> (optional; default is to use <code>Link Format</code>)
: Format for if the displayed text for the links is different, where <code>%s</code> denotes the page number. Default is to use the same value as <code>Link Format</code>.
: Format for if the displayed text for the links is different, where <code>%s</code> denotes the page number.


; <code>Current Page Format</code> (optional; default is to use <code>Display Format</code>)
; <code>Current Page Format</code> (optional; default is to use <code>Display Format</code>)
: Format for if the current-page text different, where <code>%s</code> denotes the page number. Default is to use the same value as <code>Display Format</code>.
: Format for if the current-page text different, where <code>%s</code> denotes the page number.


; <code>Is Ordinal</code> (optional; default <code>false</code>)
; <code>Is Ordinal</code> (optional; default <code>false</code>)
: If set to true, this displays numbers as ordinals instead.
: Toggles whether to display numbers as ordinals.


; <code>Is Table</code> (optional; default <code>true</code>)
; <code>Is Table</code> (optional; default <code>true</code>)
: If set to true, this displays the output as a 1-row, 3-column table. If set to false, this outputs links as one line.
: Toggles whether to output links as a 1-row 3-column table or as one line.
 
== See also ==
* [[Template:Numlinks 2-num]], an equivalent template for two varying page numbers