Template:Number box/documentation: Difference between revisions
m (Replaced Wiktionary: links with Project: links) |
m (Changed links to point to Wiktionary) |
||
Line 15: | Line 15: | ||
==Usage== | ==Usage== | ||
This template may be added to the entry of any number, whether a | This template may be added to the entry of any number, whether a {{wt|cardinal number}}, {{wt|ordinal number}} or any other kind. In languages where number words are inflected, add the template only to the [[Project:Lemmas|lemma form]], not to any of the other forms. | ||
The template should be placed within a language section, immediately following the L2 language header. If the template {{temp|rank}} is present on the same entry, then it should come first. | The template should be placed within a language section, immediately following the L2 language header. If the template {{temp|rank}} is present on the same entry, then it should come first. | ||
==Operational details== | ==Operational details== | ||
The template uses a data module for each language which contains a list of numbers and the various subtypes for each one (cardinal, ordinal etc.). When the template is added to an entry, the subtypes of the given number (parameter 2) are searched for the current page name, which lets the template automatically figure out what type of number the current page is. Links are then generated to the previous and next item of this type, i.e. adding it to | The template uses a data module for each language which contains a list of numbers and the various subtypes for each one (cardinal, ordinal etc.). When the template is added to an entry, the subtypes of the given number (parameter 2) are searched for the current page name, which lets the template automatically figure out what type of number the current page is. Links are then generated to the previous and next item of this type, i.e. adding it to {{wt|third}} will automatically create links to {{wt|second}} and {{wt|fourth}}. | ||
The data modules are [[Special:PrefixIndex/Module:number list/data|subpages of Module:number list/data]], named by language code. So for example, the data for English numbers is in [[Module:number list/data/en]]. | The data modules are [[Special:PrefixIndex/Module:number list/data|subpages of Module:number list/data]], named by language code. So for example, the data for English numbers is in [[Module:number list/data/en]]. |
Latest revision as of 02:18, 25 August 2024
This template generates a navigation box for number entries. It uses Module:number list as a back-end.
Parameters
|1=
- The language code (see Project:Languages). Required.
|2=
- The current number, using digits only (no separators or other characters). Required.
|3=
- An alternate page title, if you want the number box to display as if it was on a different page title. Not required.
|4=
- If non-empty, remove suffixes for language links in languages with suffixed terms. Not required.
|type=
- The type of number (cardinal, ordinal, etc.). Must be a key in the table for the number in the correct data module. Only needed if two numbers have the same entry name.
Usage
This template may be added to the entry of any number, whether a cardinal number, ordinal number or any other kind. In languages where number words are inflected, add the template only to the lemma form, not to any of the other forms.
The template should be placed within a language section, immediately following the L2 language header. If the template {{rank}}
is present on the same entry, then it should come first.
Operational details
The template uses a data module for each language which contains a list of numbers and the various subtypes for each one (cardinal, ordinal etc.). When the template is added to an entry, the subtypes of the given number (parameter 2) are searched for the current page name, which lets the template automatically figure out what type of number the current page is. Links are then generated to the previous and next item of this type, i.e. adding it to third will automatically create links to second and fourth.
The data modules are subpages of Module:number list/data, named by language code. So for example, the data for English numbers is in Module:number list/data/en.
Currently, only numbers that are defined in the data module are recognised. The template/module will probably be extended in the future with a means to generate numbers procedurally, meaning that they are created from scratch using a set of defined rules for each language. This would then allow the list of numbers to be extended indefinitely.