Jump to content

Template:Tx/doc: Difference between revisions

From SeptemWiki
No edit summary
Line 30: Line 30:


{{tx|foo|bar{{=}}baz}}
{{tx|foo|bar{{=}}baz}}
== Displaying multiline blocks ==
To show an example spanning multiple lines, include the <code>m=yes</code> parameter.  You will need to place a <code>&lt;br&gt;</code> after each parameter, but ''not'' after the template name.
<nowiki>{{tx|m=yes|TemplateName
|param1{{=}}A<br>
|param2{{=}}B<br>
|param3{{=}}C<br>
|...}}</nowiki>
{{tx|m=yes|TemplateName
|param1{{=}}A<br>
|param2{{=}}B<br>
|param3{{=}}C<br>
|...}}

Revision as of 17:46, 9 April 2016


Purpose

This is just a simple way to display a template example in curly braces instead of typing out

 <code> ... </code>

Example

{{tx|stub}}
{{stub}}

Displaying unnamed parameters

You can show up to 10 parameters without worrying about the pipe characters being parsed:

{{tx|main|Triparic language}}
{{main|Triparic language}}

Displaying named parameters

But if you want to show a named parameter with an equals sign, you need to use

{{=}}

to "protect" the equals sign:

{{tx|foo|bar{{=}}baz}}
{{foo|bar=baz}}

Displaying multiline blocks

To show an example spanning multiple lines, include the m=yes parameter. You will need to place a <br> after each parameter, but not after the template name.

{{tx|m=yes|TemplateName
|param1{{=}}A<br>
|param2{{=}}B<br>
|param3{{=}}C<br>
|...}}
{{TemplateName |param1=A
|param2=B
|param3=C
|...}}