Template:Module link
| This template uses Lua: |
Template:Ml (edit|talk|history|links|watch|logs) is used to display a module name as a link surrounded by braces with the {{#invoke}} parser function, thus showing the module name as code rather than actually invoking it. Its primary use is in instruction and documentation where it is used to refer to a module by name without invoking it. It is also supports the definition of a function and parameters.
Examples
| Code | Result | Notes |
|---|---|---|
| Page Template:Template journal inline/styles.css has no content.{{mlLua error: expandTemplate: template "Template journal inline/arg" does not exist.}} | Template:Ml | Usage without function name. This does not produce a usable invocation. |
| Page Template:Template journal inline/styles.css has no content.{{mlLua error: expandTemplate: template "Template journal inline/arg" does not exist.}} | Template:Ml | Usage with a function name. |
| Page Template:Template journal inline/styles.css has no content.{{mlLua error: expandTemplate: template "Template journal inline/arg" does not exist.}} | Template:Ml | Usage with a function name and parameters. |
| Page Template:Template journal inline/styles.css has no content.{{mlLua error: expandTemplate: template "Template journal inline/arg" does not exist.}} | Template:Ml | Usage with a function name and parameters, using {{=}}. |
| Page Template:Template journal inline/styles.css has no content.{{mlLua error: expandTemplate: template "Template journal inline/arg" does not exist.}} | Template:Ml | Omits the function name |
TemplateData
TemplateData for Module link
This template displays a module name as a link surrounded by braces with the {{#invoke}} parser function, thus showing how the module name would be used in code. Its primary use is in instruction and documentation.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| module name | 1 | the module name without the namespace prefix “Module:”, which is added automatically | String | required |
| function name | 2 | the function name within the module to call | String | required |
| parameter 1 | 3 | the name (and value) of the first parameter, use {{=}} to add an equal sign | String | optional |
| parameter 2 | 4 | the name (and value) of the second parameter, use {{=}} to add an equal sign | String | optional |
| parameter 3 | 5 | the name (and value) of the third parameter, use {{=}} to add an equal sign | String | optional |
See also
- {{mfl}} - Similar function but creates a link to the function paragraph in the documentation.
- {{mlx}} - Similar function but surrounded in
<code>...</code>tags. - {{tl}} - A version of this template for templates instead of modules.
General-purpose formatting
| Link style → | Linked | Unlinked | Linked with subst | Linked including braces | Linked with alternative text | |
|---|---|---|---|---|---|---|
| Text style ↓ | ↓ {{tlg}} options1 →
|
N/A | nolink=yes
|
subst=yes
|
braceinside=yes
|
alttext=Foo2=Foo
|
| Normal | N/A | {{tlg}}1, 2{{tl}}{{tlp}}2{{tlu}}4
|
{{tlf}}2
|
{{tls}}{{tlsp}}
|
{{tn}}
|
{{tla}}
|
Code
|
code=yes ortt=yes
|
{{tlx}}{{tltt}}{{tltt2}}
|
{{tlc}}2{{tld}}2{{tnull}}
|
{{tlxs}}{{tltts}}{{tltts3}}{{tltss}}3
|
N/A | |
| Bold | bold=yes
|
{{tlb}}
|
N/A | |||
Bold code
|
bold=yes|code=yes
|
{{tlxb}}
| ||||
Italic code
|
italic=yes|code=yes
|
{{tlxi}}
| ||||
- 1
{{tlg}}is the most general, allowing any combination of text style and/or link style options. - 2 Prevents wrapping of text by placing it inside
<span class="nowrap">...</span>tags. - 3 Uses monospace font but not
<code>...</code>. - 4 Allows links to templates in any namespace.
Other formatting templates
| Code example | Effect | Notes | |
|---|---|---|---|
{{tl2|Hatnote|lang=fr}} |
{{hatnote}} | Supports linking to sister projects (e.g., fr:Hatnote) | |
{{tlu|User:Ahunt/SSHFS}} |
| ||
{{xpd|Hatnote|Some hatnote text}} |
Template:Xpd | Shows code, example and a link to expand the template code |
With utility links
| Code example | Effect |
|---|---|
{{lts|Hatnote}} |
Template:Hatnote (edit talk links history) |
{{t links|Hatnote}} |
Template:T links |
{{tfd links|Hatnote}} |
Template:Tfd links |
{{tiw|Hatnote}} |
Template:hatnote (backlinks edit) |
{{tltt|Hatnote}} |
Template:Tltt |
{{tetl|Hatnote}} |
{{ Hatnote }} |
{{tsetl|Hatnote}} |
Template:Tsetl |
{{ti|Hatnote}} |
Template:Ti |
{{tic|Hatnote}} |
Template:Tic |
{{tiw|Hatnote}} |
Template:Hatnote (backlinks edit) |
{{tlt|Hatnote}} |
Template:Tlt |
{{ttl|Hatnote}} |
Template:Ttl |
{{twlh|Hatnote}} |
Template:Twlh |