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

Content deleted Content added
Testing
Added examples
Line 12:
In this example, the called template gives no arguments to the template being called.
 
'''Parent:''' <nowikipre>{{TEMPLATE|Foo|Bar|Baz}}</nowikipre>
 
'''Template:''' <nowikipre>{{#invoke:Sandbox/BrandonXLF|main|_t=ForSee also}}</nowikipre>
 
'''Result:''' {{#invoke:Sandbox/BrandonXLF|main|_t=ForSee also|Foo|Bar|Baz}}
 
In this example, the called template alters the 3rd parameter
 
'''Parent:''' <nowikipre>{{TEMPLATE|Foo|Bar|Baz}}</nowikipre>
 
'''Template:''' <nowikipre>{{#invoke:Sandbox/BrandonXLF|main|_t=ForSee also|Foobar}}</nowikipre>
 
'''Result:''' {{#invoke:Sandbox/BrandonXLF|main|_t=ForSee also|Foo|Bar|Foobar}}
 
In this example, the called template alters the 3rd parameter, but the parent doesn't define it
 
'''Parent:''' <nowikipre>{{TEMPLATE|Foo|Bar}}</nowikipre>
 
'''Template:''' <nowikipre>{{#invoke:Sandbox/BrandonXLF|main|_t=ForSee also|Foobar}}</nowikipre>
 
'''Result:''' {{#invoke:Sandbox/BrandonXLF|main|_t=ForSee also|Foo|Bar|Foobar}}
 
=== Default ===
 
To specify a default value you can use <code>{{!}}''x'' = {{(((}}''x''{{!}}''default''{{)))}}</code>.
 
With ''x'' specified:
 
'''Parent:''' <pre>{{TEMPLATE|2=416|city=[[Ottawa]]}}</pre>
 
'''Template:''' <pre>{{#invoke:Sandbox/BrandonXLF|main|_t=Jcon|hwy|city={{{city|[[Toronto]]}}}}}</pre>
 
'''Result:''' {{#invoke:Sandbox/BrandonXLF|main|_t=Jcon|hwy|416|city=[[Ottawa]]}}
 
Without ''x'' specified:
 
'''Parent:''' <pre>{{TEMPLATE|2=416}}</pre>
 
'''Template:''' <pre>{{#invoke:Sandbox/BrandonXLF|main|_t=Jcon|hwy|416|city={{{city|[[Toronto]]}}}}}</pre>
 
'''Result:''' {{#invoke:Sandbox/BrandonXLF|main|_t=Jcon|hwy|416|city=[[Toronto]]}}