Module:Template wrapper positional/doc
| This is a documentation subpage for Module:Template wrapper positional. It may contain usage information, categories and other content that is not part of the original module page. |
This is a simplified version of Module:Template wrapper that handles positional arguments better.
Syntax:
{{#invoke:Template wrapper positional|main|_template=template|_offset=offset|...extra_args}}
All args other than "_template" and "_offset" are passed unchanged to the parent template, including positional ones. Any numbered arguments are subtracted by the offset param.
This has two sets of use cases. The first is for a template to consume one (or more) positional params and forward the others somewhere else:
For example, if Template:Foo said:
{{#invoke:Template wrapper positional|main|_template=Bar|_offset=1|baz={{{1}}}}}
,
{{foo|a|b|c|quux=123}}
would turn in to:
{{Bar|b|c|baz=a|quux=123}}
The second use case is for a template to modify a positional param and pass the rest unchanged (Module:Template wrapper can't do this since it ignores positional params from the frame). For example, if Template:Foo said:
{{#invoke:Template wrapper positional|main|_template=Bar|This is param 1: {{{1}}}}}
{{foo|a|b|c|quux=123}}
would turn in to:
{{Bar|This is param 1: a|b|c|quux=123}}