Jump to content

Module:Forward parameters to template call/doc

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Tamzin (talk | contribs) at 04:00, 5 February 2022 (Created page with '{{Module rating|pre-alpha}} <!-- Add categories where indicated at the bottom of this page and interwikis at Wikidata --> == Usage == <code><nowiki>{{</nowiki>subst:#invoke:{{subst:BASEPAGENAME}}|main|_template=''template name''<nowiki>}}</nowiki></code> This module is for the very particular set of circumstances: when a substituted template needs to dynamically generate the wikimarkup for a template call, forwarding all numbered parameters. It also allow...'). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)


Usage

{{subst:#invoke:Sandbox/Tamzin/Forward paramaters|main|_template=template name}}

This module is for the very particular set of circumstances: when a substituted template needs to dynamically generate the wikimarkup for a template call, forwarding all numbered parameters. It also allows for the option of designating a prefix for a series of named parameters which will be converted to numbered ones. Because it generates wikitext, this module only works when substituted.

To specify a prefix to convert to numbered parameters, set {{{_convert_prefix}}} (or {{{_convert_prefix1}}}, {{{_convert_prefix2}}}, etc.) The order of items within that family of parameters will be retained, with those items being placed after any true numbered parameters. For instance, {{subst:#invoke:Sandbox/Tamzin/Forward paramaters|main|_template=foo|_convert_prefix=bar|1|2|bar2=b|bar1=a}} will become {{foo|1=1|2=2|3=a|4=b}}. If multiple prefixes are converted, order of items within each set is retained, but the ordering of the sets may not be.