Jump to content
Toggle menu
  • 3 articles
  • 75 files
  • 7 users
  • 37.9K edits
Neodyland Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:LayoutTemplateArgs/doc: Difference between revisions

Template page
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={{en|List of template parameters, URL-encoded and separated by whitespace (see above)}}
|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={{en|The name of the template for which these parameters are meant for, without the "Template:" prefix}}
|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={{en|Helper template for passing parameters to templates using the [[MediaWiki talk:AjaxTranslation.js|Ajax in-line template translation]] feature}}
|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 "&#124;"), 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 "&#124;"), with each parameter URL-encoded.}}


'''Example:'''<br />
'''Example:'''
<tt>
 
&#123;&#123;LayoutTemplateArgs&#124;template=FooBar&#124;args=<br />
&#123;&#123;LayoutTemplateArgs&#124;template=<var>&lt;Template name&gt;</var>&#124;args=
&#123;&#123;urlencode: 1=&#123;&#123;&#123;1&#124;&#125;&#125;&#125; &#125;&#125;<br />
&#123;&#123;urlencode: 1=&#123;&#123;&#123;1&#124;&#125;&#125;&#125; &#125;&#125;
&#123;&#123;urlencode: 2=&#123;&#123;&#123;2&#124;&#125;&#125;&#125; &#125;&#125;<br />
&#123;&#123;urlencode: 2=&#123;&#123;&#123;2&#124;&#125;&#125;&#125; &#125;&#125;
&#123;&#123;urlencode: foo=&#123;&#123;&#123;foo&#124;&#125;&#125;&#125; &#125;&#125;<br />
&#123;&#123;urlencode: foo=&#123;&#123;&#123;foo&#124;&#125;&#125;&#125; &#125;&#125;
&#123;&#123;urlencode: bar=&#123;&#123;&#123;bar&#124;&#125;&#125;&#125; &#125;&#125;<br />
&#123;&#123;urlencode: bar=&#123;&#123;&#123;bar&#124;&#125;&#125;&#125; &#125;&#125;
&#125;&#125;
&#125;&#125;
</tt>


|type=
|type=
Line 37: Line 43:
|relieson=
|relieson=
* [[MediaWiki:AjaxTranslation.js]]
* [[MediaWiki:AjaxTranslation.js]]
|useTemplateData=only
}}
}}


Line 61: Line 68:


<pre>
<pre>
{{LayoutTemplateArgs|template=FooBar|args=
{{LayoutTemplateArgs|template=&lt;Template name&gt;|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 &lt;nowiki&gt;, &lt;pre&gt;, &lt;poem&gt;, &lt;ref&gt;, &lt;gallery&gt;, etc. tags turn into gibberish.'''
'''Parameters containing &lt;nowiki&gt;, &lt;pre&gt;, &lt;poem&gt;, &lt;ref&gt;, &lt;gallery&gt;, etc. tags <s>turn into gibberish</s> cause the in-line replacement not to work.'''
:This is a known bug in the MediaWiki &#123;&#123;[[mw:Help:Magic words#URL data|urlencode]]:&#125;&#125; parser function: when given input containing "parser extension tags", those tags and their content get replaced by internal "strip markers" which look something like "&#x7F;UNIQ77ef13a860481bc0-nowiki-00000010-QINU&#x7F;".  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 &#123;&#123;[[mw:Help:Magic words#URL data|urlencode]]:&#125;&#125; parser function: when given input containing "parser extension tags", those tags and their content get replaced by internal "strip markers" which look something like "&#x7F;UNIQ77ef13a860481bc0-nowiki-00000010-QINU&#x7F;".  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.'''
Cookies help us deliver our services. By using our services, you agree to our use of cookies.