Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

Jump to content

Module:Template wrapper positional/doc

From Wikipedia, the free encyclopedia

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}}