Open main menu
Home
Random
Donate
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:Template wrapper/doc
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Debugging/documentation mode== This module has two entry points. A wrapper template might use a module <code><nowiki>{{#invoke:}}</nowiki></code> written like this: :<code><nowiki>{{#invoke:</nowiki>{{BASEPAGENAME}}|<nowiki>{{#if:{{{_debug|}}}|list|wrap}}</nowiki>|_template=<{{var|working template}}>|_exclude=_debug, ...|...}}</code> where the {{para|_debug}} wrapper parameter, set to any value, will cause the module to render the call to the working template without actually calling the working template. As an example, {{tlx|cite wikisource}} is a wrapper template that uses {{tlx|citation}} as its working template. {{tld|cite wikisource}} accepts positional parameters but {{tld|citation}} does not so the wrapper template must convert the positional parameters to named parameters which it does using the {{para|_alias-map}} parameter: :<syntaxhighlight lang="moin">{{#invoke:template wrapper|{{#if:{{{_debug|}}}|list|wrap}}|_template=citation |_exclude=..., _debug <!-- unnecessary detail omitted --> |_alias-map=1:title, 2:author, 3:language</syntaxhighlight> This example uses positional parameters and sets {{para|_debug|yes}} to show that the {{tld|citation}} template is correctly formed: :<code><nowiki>{{cite wikisource|Sentido y sensibilidad|Jane Austen|es|_debug=yes}}</nowiki></code> ::{{cite wikisource|Sentido y sensibilidad|Jane Austen|es|_debug=yes}} and, with {{para|_debug}} unset: :<code><nowiki>{{cite wikisource|Sentido y sensibilidad|Jane Austen|es|_debug=}}</nowiki></code> ::{{cite wikisource|Sentido y sensibilidad|Jane Austen|es|_debug=}} The {{para|_debug}} name is chosen here for convenience but may be anything so long as it matches the <code><nowiki>{{#if:}}</nowiki></code> in the <code><nowiki>{{#invoke:}}</nowiki></code>. You may also call the <code>link</code> function to get something like the left-hand side of [[Template:yy]]. This is essentially the <code>list</code> function with the template name turned into a link. {{yytop|headers=no}} {{yy|User in New Zealand|4}} {{yybottom}} <includeonly>{{sandbox other|| <!-- Categories below this line, please; interwikis at Wikidata --> }}</includeonly>
Summary:
Please note that all contributions to Stockhub may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Stockhub:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)