Template:Template link with magic/doc
| This is a documentation subpage for Template:Template link with magic. It may contain usage information, categories and other content that is not part of the original template page. |
| This template uses Lua: |
This template is an all-purpose double-brace linking template. The magic is implemented by Module:Template link with magic.
Usage
[edit]{{Template link with magic}} (shortcut {{tlm}}) may be used for linking to templates, quasi-templates (pages transcluded from namespaces other than Template), modules (using the #invoke syntax), documentation of parser functions and variables (so-called "magic words"). subst: and other modifier prefixes and other[clarification needed] are detected automatically and linked appropriately.
Syntax:
{{tlm|[[safe]subst:][msg[nw]:][raw:]name of template|...}}
{{tlm|[[safe]subst:][msg[nw]:][raw:]namespace:pagename|...}}
{{tlm|[[safe]subst:][msg[nw]:][raw:]#invoke:module name|...}}
{{tlm|[[safe]subst:][msg[nw]:][raw:]#parser function:...[|...]}}
{{tlm|[[safe]subst:]VARIABLE NAME}}
If this template is passed non-numeric named parameters, they will be displayed: {{tlm|unreferenced|date=August 2026}} → {{unreferenced|date=August 2026}}. No particular order of parameters is guaranteed, and it will not work for numeric parameters, even explicitly named ones: {{tlm|X0|2=2}} → {{X0|2}}.
The output will be rendered as code. To avoid that (which is especially useful for nesting), use
{{Template link with magic nested}} (shortcut {{tlmn}}):
- Plain text:
{{tlmn|Citation needed}}→ {{Citation needed}} - Nested:
{{tlm|unreferenced|date={{tlmn|subst:CURRENTMONTHNAME}} {{tlmn|subst:CURRENTYEAR}}}}→{{unreferenced|date={{subst:CURRENTMONTHNAME}} {{subst:CURRENTYEAR}}}}- Otherwise (using
{{tlm}}instead of{{tlmn}}) you would have code formatting inside code formatting: →{{unreferenced|date=This may be visually subtle, but it's semantically incorrect.{{subst:CURRENTMONTHNAME}}{{subst:CURRENTYEAR}}}}
- Otherwise (using
See also
[edit]{{magic word link}}(shortcut {{mwl}})