Jump to content
Toggle menu
  • 8 articles
  • 75 files
  • 7 users
  • 37.8K 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
usage and known bugs
document new "template" parameter
Line 4: Line 4:
|1def=
|1def=
|1stat=required
|1stat=required
|2=template
|2d={{en|The name of the template for which these parameters are meant for, without the "Template:" prefix}}
|2def=
|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}}
Line 13: Line 17:
'''Example:'''<br />
'''Example:'''<br />
<tt>
<tt>
&#123;&#123;LayoutTemplateArgs&#124;args=<br />
&#123;&#123;LayoutTemplateArgs&#124;template=FooBar&#124;args=<br />
&#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;<br />
&#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;<br />
Line 54: Line 58:


'''Step 2:'''
'''Step 2:'''
Edit the "/layout" subpage and insert <code>{{tl|LayoutTemplateArgs|2=args=...}}</code> ''inside'' the element with the "layouttemplate" class, as early as possible.  If the element is a div, you can just put it immediately after the &lt;div&gt; tag; if it's a table, put it at the beginning of the the first table cell.  The value of the "args" parameter should contain all the parameters you want to have passed to the translated versions during in-line replacement, ''individually URL-encoded and separated by whitespace'' (i.e. spaces or linebreaks; ''not'' pipes as in normal template calls).  For example, if your template takes the same parameters as above, the code you should add to the "/layout" subpage would be:
Edit the "/layout" subpage and insert <code>{{tl|LayoutTemplateArgs|2=template=...&#124;args=...}}</code> ''inside'' the element with the "layouttemplate" class, as early as possible.  If the element is a div, you can just put it immediately after the &lt;div&gt; tag; if it's a table, put it at the beginning of the the first table cell.  The value of the "args" parameter should contain all the parameters you want to have passed to the translated versions during in-line replacement, ''individually URL-encoded and separated by whitespace'' (i.e. spaces or linebreaks; ''not'' pipes as in normal template calls).  For example, if your template takes the same parameters as above, and is named [[Template:FooBar]], the code you should add to [[Template:FooBar/layout]] would be:


<pre>
<pre>
{{LayoutTemplateArgs|args=
{{LayoutTemplateArgs|template=FooBar|args=
{{urlencode: 1={{{1|}}} }}
{{urlencode: 1={{{1|}}} }}
{{urlencode: 2={{{2|}}} }}
{{urlencode: 2={{{2|}}} }}
Cookies help us deliver our services. By using our services, you agree to our use of cookies.