Module:Sandbox/BrandonXLF/1/doc: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 1:
{{lmd|All parameters}} Calls a template while giving it all the arguments the current page receives.
 
Arguments directly given to the module are prioritized over ones given to the current page unless {{para|_pf|yes}}.
 
== ParametersUsage ==
 
=== Syntax ===
* {{para|_t}} The template to call
* {{para|''x''}} ''x'' represents any parameter, parameter ''x'' will be send to the template that is called.
 
{{mlix|All parameters|main|_t{{=}}|_pt{{=}}|''x''}}
== Examples ==
 
=== Parameters ===
In this example, the called template gives no arguments to the template being called.
 
* {{para|_t}} The template to call.
'''Parent:''' <pre>{{TEMPLATE|Foo|Bar|Baz}}</pre>
* {{para|_pf|yes}} Forces parent arguments to override the arguments given to the module.
 
* {{para|''x''}} ''x'' represents any parameter, parameter ''x'' will be send to the template that is called.
'''Template:''' <pre>{{#invoke:Sandbox/BrandonXLF/1|main|_t=See also}}</pre>
 
'''Result:''' {{#invoke:Sandbox/BrandonXLF/1|main|_t=See also|Foo|Bar|Baz}}
 
In this example, the called template alters the 3rd parameter
 
'''Parent:''' <pre>{{TEMPLATE|Foo|Bar|Baz}}</pre>
 
'''Template:''' <pre>{{#invoke:Sandbox/BrandonXLF/1|main|_t=See also|Foobar}}</pre>
 
'''Result:''' {{#invoke:Sandbox/BrandonXLF/1|main|_t=See also|Foo|Bar|Foobar}}
 
In this example, the called template alters the 3rd parameter, but the parent doesn't define it
 
'''Parent:''' <pre>{{TEMPLATE|Foo|Bar}}</pre>
 
'''Template:''' <pre>{{#invoke:Sandbox/BrandonXLF/1|main|_t=See also|Foobar}}</pre>
 
'''Result:''' {{#invoke:Sandbox/BrandonXLF/1|main|_t=See also|Foo|Bar|Foobar}}
 
=== Default ===
 
* To set all parameters as defaults set {{para|_pf|yes}}.
To specify a default value you can use <code>{{!}}''x'' = {{(((}}''x''{{!}}''default''{{)))}}</code>.
* To set individual parameters as default use {{para|''x''|{{param|''x''|''default''|nested=yes}}}}.
 
With ''x'' specified:
 
'''Parent:''' <pre>{{TEMPLATE|2=416|city=[[Ottawa]]}}</pre>
 
'''Template:''' <pre>{{#invoke:Sandbox/BrandonXLF/1|main|_t=Jcon|hwy|city={{{city|[[Toronto]]}}}}}</pre>
 
'''Result:''' {{#invoke:Sandbox/BrandonXLF/1|main|_t=Jcon|hwy|416|city=[[Ottawa]]}}
 
Without ''x'' specified:
 
'''Parent:''' <pre>{{TEMPLATE|2=416}}</pre>
 
'''Template:''' <pre>{{#invoke:Sandbox/BrandonXLF/1|main|_t=Jcon|hwy|416|city={{{city|[[Toronto]]}}}}}</pre>
 
'''Result:''' {{#invoke:Sandbox/BrandonXLF/1|main|_t=Jcon|hwy|416|city=[[Toronto]]}}