Template:LayoutTemplateArgs/doc: Difference between revisions
Template page
More actions
document new "template" parameter |
<var> tags *are* needed, because there is no replacement (SyntaxHighlight has no way to guess that I don’t mean that piece of text literally); there are no faux headers, they’re simply not headers, neither syntactically nor semantically |
||
| (10 intermediate revisions by 5 users not shown) | |||
| Line 1: | Line 1: | ||
{{TemplateBox | {{TemplateBox | ||
|1=args | |1=args | ||
|1d= | |1label-en=parameters | ||
|1d-en=List of template parameters, URL-encoded and separated by whitespace (see above) | |||
|1type=content | |||
|1def= | |1def= | ||
|1stat=required | |1stat=required | ||
|2=template | |2=template | ||
|2d= | |2label-en=template name | ||
|2d-en=The name of the template for which these parameters are meant for, without the "Template:" prefix | |||
|2type=wiki-template-name | |||
|2def= | |2def= | ||
|2stat=required | |2stat=required | ||
|name=LayoutTemplateArgs | |name=LayoutTemplateArgs | ||
|desc= | |desc-en=Helper template for passing parameters to templates using the [[MediaWiki talk:AjaxTranslation.js|Ajax in-line template translation]] feature | ||
|desc-td-en=Helper template for passing parameters to templates using the Ajax in-line template translation feature | |||
|namespace=10 | |namespace=10 | ||
|usergroup=all | |usergroup=all | ||
| Line 15: | Line 22: | ||
|usage-notes={{en|The value of the "args" parameter should be a list of template parameters separated by whitespace (''not'' by "|"), with each parameter URL-encoded.}} | |usage-notes={{en|The value of the "args" parameter should be a list of template parameters separated by whitespace (''not'' by "|"), with each parameter URL-encoded.}} | ||
'''Example:''' | '''Example:''' | ||
{{LayoutTemplateArgs|template= | {{LayoutTemplateArgs|template=<var><Template name></var>|args= | ||
{{urlencode: 1={{{1|}}} }} | {{urlencode: 1={{{1|}}} }} | ||
{{urlencode: 2={{{2|}}} }} | {{urlencode: 2={{{2|}}} }} | ||
{{urlencode: foo={{{foo|}}} }} | {{urlencode: foo={{{foo|}}} }} | ||
{{urlencode: bar={{{bar|}}} }} | {{urlencode: bar={{{bar|}}} }} | ||
}} | }} | ||
|type= | |type= | ||
| Line 37: | Line 43: | ||
|relieson= | |relieson= | ||
* [[MediaWiki:AjaxTranslation.js]] | * [[MediaWiki:AjaxTranslation.js]] | ||
|useTemplateData=only | |||
}} | }} | ||
| Line 61: | Line 68: | ||
<pre> | <pre> | ||
{{LayoutTemplateArgs|template= | {{LayoutTemplateArgs|template=<Template name>|args= | ||
{{urlencode: 1={{{1|}}} }} | {{urlencode: 1={{{1|}}} }} | ||
{{urlencode: 2={{{2|}}} }} | {{urlencode: 2={{{2|}}} }} | ||
| Line 75: | Line 82: | ||
There are a couple of known bugs in this template and in the associated [[MediaWiki:AjaxTranslation.js|Ajax translation script]], including: | There are a couple of known bugs in this template and in the associated [[MediaWiki:AjaxTranslation.js|Ajax translation script]], including: | ||
'''Parameters containing <nowiki>, <pre>, <poem>, <ref>, <gallery>, etc. tags turn into gibberish.''' | '''Parameters containing <nowiki>, <pre>, <poem>, <ref>, <gallery>, etc. tags <s>turn into gibberish</s> cause the in-line replacement not to work.''' | ||
:This is a known bug in the MediaWiki {{[[mw:Help:Magic words#URL data|urlencode]]:}} parser function: when given input containing "parser extension tags", those tags and their content get replaced by internal "strip markers" which look something like "UNIQ77ef13a860481bc0-nowiki-00000010-QINU". Unfortunately, there's no way for the Ajax translation script to work out what the content replaced by such strip markers might've originally been. | :This is a known bug in the MediaWiki {{[[mw:Help:Magic words#URL data|urlencode]]:}} parser function: when given input containing "parser extension tags", those tags and their content get replaced by internal "strip markers" which look something like "UNIQ77ef13a860481bc0-nowiki-00000010-QINU". Unfortunately, there's no way for the Ajax translation script to work out what the content replaced by such strip markers might've originally been. The current implementation reverts to opening the translated template on a new page if it detects any strip markers in the parameters. | ||
'''Very long parameter values cause the in-line replacement not to work.''' | '''Very long parameter values cause the in-line replacement not to work.''' | ||