Sjabloon:User-multi/doc
40px | This is a documentation subpage for Sjabloon:User-multi. It contains usage information, categories, interlanguage links and other content that is not part of the original sjabloon page. |
This template is used on 210,000+ pages. To avoid large-scale disruption and unnecessary server load, any changes to this template should first be tested in its /sandbox or /testcases subpages, or in your own user space. The tested changes can then be added to this page in one single edit. Please consider discussing any changes on the talk page before implementing them. |
42px | This template uses Module:UserLinks, a script written in the Lua programming language. Please see Wikipedia:Lua if you want to learn more about Lua or help convert other templates. |
This is a very flexible user link template, which allows you to specify which links are shown beside the username. It can be used as a meta-template to support other user link templates, or it can be used alone.
Usage
- Standalone usage
- Usage in templates
{{User-multi<noinclude>/template</noinclude> | User = {{{1|{{{User|{{{user|}}}}}}}}} | Project = {{{2|{{{Project|{{{project|}}}}}}}}} | Lang = {{{3|{{{Lang|{{{lang|}}}}}}}}} | separator = {{{separator|dot}}} | small = <!-- yes --> | sup = <!-- yes --> | 1 = <!-- link code 1 --> | 2 = <!-- link code 2 --> | 3 = <!-- link code 3 --> ... | demo = {{{demo|}}} | doc = <!-- yes --> }}
The doc parameter is used to provide automatic documentation on the template page, i.e. |doc=yes
.
Parameters
- 1, 2, 3, ... n: these parameters specify what links to display in the template. See the code table below for valid input codes.
- User or user: the username. An error is returned if this is omitted.
- Project or project: the interwiki prefix for the project you wish to link to. Please see Help:Interwiki linking for a list of valid codes. The template also accepts input in the form "xx:yy", where xx and yy are either valid interwiki prefixes or valid language codes. It will try to guess the correct project and language values from this input.
- Lang or lang: the language code for the project you wish to link to. See List of Wikipedias for a complete list of language codes used by Wikimedia sites.
- separator: the separator to use in between links. Valid values are
dot
({{int:dot-separator),comma
({{int:comma-separator),pipe
({{int:pipe-separator), andtpt-languages
({{int:tpt-languages-separator). If not specified, thendot
is the default. - small: if this parameter exists, fonts will be displayed at 90% of the normal size.
- sup: if this parameter exists, links will be displayed in superscript.
- doc: this parameter is only available on template pages, using the /template sub-template. If set to
yes
, it will automatically generate documentation for that template. - demo: if this parameter is set to
yes
, the template will not output any categories.
Codes
Here is a list of currently supported link codes: {{#invoke:UserLinks|linktable|User=Example}}
Examples
Code | Output |
---|---|
{{user-multi|user=Example|t|c|e}} |
main}} |
{{user-multi|user=Example|t|c|ct|m|l}} |
main}} |
{{user-multi|user=Example|lang=es|t|c|e}} |
main}} |
{{user-multi|user=Example|project=b|t|c|e}} |
main}} |
{{user-multi|user=Example|project=b:es|t|c|e}} |
main}} |
{{user-multi|user=Example|t|c|e|sup=yes}} |
main}} |
{{user-multi|user=Example|t|c|e|small=yes}} |
main}} |
Errors
In certain circumstances, the template will generate errors. This is a list of all the error messages that the template might generate, and how users can resolve them.
No username detected
- User-multi error: no username detected.
There are two possible reasons for this error. The first is simply that you have not specified a username, or you have specified a username using an unrecognised parameter name. The second is that your username contains an equals sign, and that is causing the template to interpret the first half of your username as a parameter name. Both of these problems can be fixed by trying different parameters for the username. Try using |1=your username
, |User=your username
, and |user=your username
, and if none of those work please start a new thread at Template talk:User-multi.
Not a valid language code
- User-multi error: "xyz" is not a valid language code.
This error is generated if an invalid language code is specified. The language code must be a ISO 639-1 code; for example, English is en
and German is de
. For a complete list of valid language codes, see the List of Wikipedias.
Not a valid interwiki prefix
- User-multi error: "xyz" is not a valid interwiki prefix.
- User-multi error: "ab:cd" is not a valid interwiki prefix.
This error is produced if the template is not able to process the project parameter. The project parameter must either be a valid interwiki prefix, or a valid language code, or in the format "xx:yy" where xx and yy are either valid interwiki prefixes or valid language codes. See Help:Interwiki linking for a list of valid interwiki prefixes, and the section on language code errors directly above for more details on valid language codes.
If you are sure that the interwiki prefix is valid, but you still get this error, it might be a bug in the software. This template uses Module:InterwikiTable for interwiki prefix data, so you can check to see if your site and your prefix exist in the table and fix it if they don't. If that fails to resolve the problem, please start a new thread at Template talk:User-multi.
Not a valid link code
- User-multi error: "xyz" is not a valid link code.
This error is generated if an invalid link code is specified. For a list of valid link codes, see the code list above.
No link type specified
- User-multi error: no link type specified.
This error is only generated when using Module:UserLinks directly to create a single link. The link code must be in the first positional parameter, like this: {{#invoke:UserLinks|single|<!-- link code -->|<!-- other parameters -->}}
.
Function did not return a string value
- User-multi error: the function for code "xyz" did not return a string value.
This is an error in the software generating the links, and requires attention from the developers. Please start a new thread at Template talk:User-multi.
Tracking categories
The template uses the following tracking categories:
- Error category
- Category:UserLinks transclusions with errors - this is used to track all the errors listed above
- Other tracking categories
- Category:UserLinks transclusions with unresolvable interwiki links
- Category:UserLinks transclusions with language parameters
- Category:UserLinks transclusions with project parameters
- Category:UserLinks transclusions with project parameters containing language codes
Adding new links
To add a new link, you need to edit the Lua module that this template is based on, Module:UserLinks. Instructions are in the source code, if you feel capable programming in Lua. If you're not familiar with Lua, feel free to make a request on Template talk:User-multi, and someone might add the link for you.