Template:Module link expanded/doc

Template:Module link expanded (edit|talk|history|links|watch|logs) (often abbreviated {{mlx}}) is used to display a module name as a link surrounded by braces with the Template:((#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.{{mlxLua error: expandTemplate: template "Template journal inline/arg" does not exist.}} {{#invoke:Example|function}} Usage without function name. This does not produce a usable invocation.
Page Template:Template journal inline/styles.css has no content.{{mlxLua error: expandTemplate: template "Template journal inline/arg" does not exist.}} {{#invoke:Example|hello}} Usage with a function name.
Page Template:Template journal inline/styles.css has no content.{{mlxLua error: expandTemplate: template "Template journal inline/arg" does not exist.}} {{#invoke:Example|count_fruits|bananas=5|apples=10}} Usage with a function name and parameters.
Page Template:Template journal inline/styles.css has no content.{{mlxLua error: expandTemplate: template "Template journal inline/arg" does not exist.}} {{#invoke:Example|count_fruits|bananas=5|apples=10}} Usage with a function name and parameters, using Template:((=}}.

TemplateData

This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Module link expanded in articles based on its TemplateData.

TemplateData for Module link expanded

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.

Template parameters

ParameterDescriptionTypeStatus
module name1

the module name without the namespace prefix “Module:”, which is added automatically

Stringrequired
function name2

the function name within the module to call

Stringrequired
parameter 13

the name (and value) of the first parameter, use {{=}} to add an equal sign

Stringoptional
parameter 24

the name (and value) of the second parameter, use {{=}} to add an equal sign

Stringoptional
parameter 35

the name (and value) of the third parameter, use {{=}} to add an equal sign

Stringoptional

See also

  • {{ml}} – similar function but not surrounded in <code>...</code> tags
  • {{mfl}} – similar to {{ml}} but creates a link to the function's documentation
  • {{tlx}} – a version of this template for templates instead of modules

view · talk · edit


General-purpose formatting

  • 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}}
  1. REDIRECT Template:Template link universal
|| Supports linking to any namespace
{{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 }}
links talk view
{{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