Module:Sandbox/BrandonXLF/1/doc

This is an old revision of this page, as edited by BrandonXLF (talk | contribs) at 05:51, 4 January 2019 (Example). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Module:All args (edit | talk | history | links | watch | logs) 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.

Parameters

  • |_t= The template to call
  • |x= x represents any parameter, parameter x will be send to the template that is called.

Examples

In this example, the called template gives no arguments to the template being called.

Parent:

{{TEMPLATE|Foo|Bar|Baz}}

Template:

{{#invoke:Sandbox/BrandonXLF|main|_t=See also}}

Result: Script error: The module returned a nil value. It is supposed to return an export table.

In this example, the called template alters the 3rd parameter

Parent:

{{TEMPLATE|Foo|Bar|Baz}}

Template:

{{#invoke:Sandbox/BrandonXLF|main|_t=See also|Foobar}}

Result: Script error: The module returned a nil value. It is supposed to return an export table.

In this example, the called template alters the 3rd parameter, but the parent doesn't define it

Parent:

{{TEMPLATE|Foo|Bar}}

Template:

{{#invoke:Sandbox/BrandonXLF|main|_t=See also|Foobar}}

Result: Script error: The module returned a nil value. It is supposed to return an export table.

Default

To specify a default value you can use |x = {{{x|default}}}.

With x specified:

Parent:

{{TEMPLATE|2=416|city=[[Ottawa]]}}

Template:

{{#invoke:Sandbox/BrandonXLF|main|_t=Jcon|hwy|city={{{city|[[Toronto]]}}}}}

Result: Script error: The module returned a nil value. It is supposed to return an export table.

Without x specified:

Parent:

{{TEMPLATE|2=416}}

Template:

{{#invoke:Sandbox/BrandonXLF|main|_t=Jcon|hwy|416|city={{{city|[[Toronto]]}}}}}

Result: Script error: The module returned a nil value. It is supposed to return an export table.