Jump to content

Template:LayoutTemplateArgs/doc: Difference between revisions

m
Text replacement - "|" to "|"
(create page)
 
m (Text replacement - "|" to "|")
 
Line 13: Line 13:
|usergroup=all
|usergroup=all
|placement={{en|This template should be used on the "/layout" subpage of an autotranslated template, within the element with the "layouttemplate" class, preferably before any actual content.}}
|placement={{en|This template should be used on the "/layout" subpage of an autotranslated template, within the element with the "layouttemplate" class, preferably before any actual content.}}
|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:'''<br />
'''Example:'''<br />
<tt>
<tt>
&#123;&#123;LayoutTemplateArgs&#124;template=FooBar&#124;args=<br />
&#123;&#123;LayoutTemplateArgs|template=FooBar|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|&#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|&#125;&#125;&#125; &#125;&#125;<br />
&#123;&#123;urlencode: foo=&#123;&#123;&#123;foo&#124;&#125;&#125;&#125; &#125;&#125;<br />
&#123;&#123;urlencode: foo=&#123;&#123;&#123;foo|&#125;&#125;&#125; &#125;&#125;<br />
&#123;&#123;urlencode: bar=&#123;&#123;&#123;bar&#124;&#125;&#125;&#125; &#125;&#125;<br />
&#123;&#123;urlencode: bar=&#123;&#123;&#123;bar|&#125;&#125;&#125; &#125;&#125;<br />
&#125;&#125;
&#125;&#125;
</tt>
</tt>
Line 58: Line 58:


'''Step 2:'''
'''Step 2:'''
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:
Edit the "/layout" subpage and insert <code>{{tl|LayoutTemplateArgs|2=template=...|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>