Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
DOORS Site Logo

Welcome to the Official DOORS Wiki!
Please read the Wiki Rules the Manual of Style and familiarise yourself with our Wiki Policies before contributing to get a better understanding of what content is allowed on our wiki and how to display it properly, if you need help don't hesitate to reach out to a DOORS Wiki Staff Member.

Editing Template:T/doc

Template page
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
;Description
<noinclude>{{Documentation subpage}}</noinclude>
A template link with a variable number of parameters (0-20).
== Description ==
This is a template link with a variable number of example parameters (0–30), which can be used to show example inputs.
== Parameters ==
;First parameter
:The link to the template. Defaults to the page name (current page name: '''{{PAGENAME}}''')
:
;2nd to 31st parameter
:The parameters of the demo template.
:
:To add ''named parameters'', example <code><nowiki>{{Icons|1st parameter|2nd parameter|text=3rd parameter}}</nowiki></code>, follow these steps:
:# Write the parameter normally. Example: <code><nowiki>{{T|Icons|1st parameter|2nd parameter|text=3rd parameter}}</nowiki></code>.
:# Then, count how many parameters you have added, so <code>{<nowiki/>{T|''Icons''|''1st parameter''|''2nd parameter''|'''text=3rd parameter'''}}</code>. <br/> On this example, there are '''4''' parameters, so prefix <code>4=</code> on the {{T|T}} template.
:# So, the code is <code>{<nowiki/>{T|Icons|1st parameter|2nd parameter|'''''4='''text=3rd parameter''}}</code>, which results in {{T|Icons|1st parameter|2nd parameter|4=text=3rd parameter}}.
:
:Note: Adding named parameters will force you to always prefix the unnamed parameter:
::<code><nowiki>{{T|Icons|1st parameter|2nd parameter|4=3=3rd parameter|4th parameter}}</nowiki></code> will '''not work'''.
::<code><nowiki>{{T|Icons|1st parameter|2nd parameter|4=3=3rd parameter|5=4th parameter}}</nowiki></code> '''will work'''.
----
The following will only work after all the parameters of the demo template is placed.<br/>
'''Wrong''': <nowiki>{{T|Icons|style=code|<message>}}</nowiki><br/>
'''Right''': <nowiki>{{T|Icons|<message>|style=code}}</nowiki>


;Syntax
;Style (<code>style=</code>)
:{{t|t|parameter1|parameter2|parameter3|parameter4|...|parameter20}} <!-- self-referential examples! -->
:The style of the {{T|T}} template. Has 3 styles:
:* (none) - encloses the {{T|T}} template with <code><nowiki><code></nowiki></code>
:* <code>plain</code> - encloses the {{T|T}} template with <code><nowiki><span></nowiki></code>
:* <code>code</code> - encloses the {{T|T}} template with <code><nowiki><code></nowiki></code> and adds styling to the code element.
:* <code>pre</code> - encloses the {{T|}} template with a HTML <code><nowiki><pre></nowiki></code> tag.
:
;Prefix (<code>prefix=</code>)
:A prefix ''before'' the template link, useful when instructing the user to add <code>subst</code>, <code>safesubst</code>, or something similar. The output will be similar to: <code><nowiki>prefix:[[template link]]</nowiki></code>
:Note: This '''does not''' add a prefix to the link itself. Use <code>linkprefix</code> instead as listed below.
:
;Link Prefix (<code>linkprefix=</code>)
:A prefix ''added to'' the template link, for linking to other languages or wikis. <code><nowiki>[[linkprefix:template link]]</nowiki></code>
:Note: This adds the prefix to the link itself. To add a prefix not included on the link, see above.
:
;Block Mode (<code>block=</code>)
:Makes the template styled as a block template, to aid in readablity. Combine with <code>style=pre</code> to get the best results.


;Source
=== Parameter limit ===
:Improved version not needing t/piece subtemplate developed on [http://templates.fandom.com Templates wiki] see the [http://templates.fandom.com/index.php?title=Template:T&action=history list of authors]. Copied here via CC-By-SA 3.0 license.
This template has a parameter limit of 30 items. If you exceed that limit, this will show up:
:<span class="error">Template parameter limit reached! ([[Template:T#Parameter limit|help]])</span>


;Example
You can remove this warning and add more parameter checks to the template, however this might take some time depending on how many parameters you want.
:{{t|t|param1|param2}}


<includeonly>[[Category:General wiki templates]]</includeonly>
If you want unlimited parameters alongside other features, please see [[w:c:dev:Global Lua Modules/T]].
<noinclude>[[Category:Template documentation]]</noinclude>

== Examples ==
=== Basic ===
{| class="wikitable"
! Syntax
! Output
|-
| <code><nowiki>{{T}}</nowiki></code>
| {{T}} (uses the page name)
|-
| <code><nowiki>{{T|Icons}}</nowiki></code>
| {{T|Icons}}
|-
| <code><nowiki>{{T|Icons|Item1|Item2|Item3|Item4|Item5|...}}</nowiki></code>
| {{T|Icons|Item1|Item2|Item3|Item4|Item5|...}}
|}

=== Named parameters ===
{| class="wikitable"
! Syntax
! Output
|-
| <code><nowiki>{{T|Icons|2=param1=Item1}}</nowiki></code>
| {{T|Icons|2=param1=Item1}}
|-
| <code><nowiki>{{T|Icons|2=param1=Item1|3=param2=Item2}}</nowiki></code>
| {{T|Icons|2=param1=Item1|3=param2=Item2}}
|-
| <code><nowiki>{{T|Icons|example|3=param1=Item1|4=param2=Item2}}</nowiki></code>
| {{T|Icons|example|3=param1=Item1|4=param2=Item2}}
|}

=== Prefixes ===
{| class="wikitable"
! Syntax
! Output
|-
| <code><nowiki>{{T|Icons|prefix=subst}}</nowiki></code>
| {{T|Icons|prefix=subst}}
|-
| <code><nowiki>{{T|Icons|linkprefix=w}}</nowiki></code>
| {{T|Icons|linkprefix=w}}
|-
| <code><nowiki>{{T|Icons|linkprefix=w|prefix=subst}}</nowiki></code>
| {{T|Icons|linkprefix=w|prefix=subst}}
|}

=== Styling ===
{| class="wikitable"
! Syntax
! Output
|-
! colspan="2" | Normal
|-
| <code><nowiki>{{T|Icons|style=code}}</nowiki></code>
| {{T|Icons|style=code}}
|-
| <code><nowiki>{{T|Icons|style=plain}}</nowiki></code>
| {{T|Icons|style=plain}}
|-
| <code><nowiki>{{T|Icons|2=Item1|3=Item2|4=Item3|style=pre}}</nowiki></code>
| {{T|Icons|2=Item1|3=Item2|4=Item3|style=pre}}
|-
! colspan="2" | With <code>block=</code>
|-
| <code><nowiki>{{T|Icons|style=code|block=yes}}</nowiki></code>
| {{T|Icons|style=code|block=yes}}
|-
| <code><nowiki>{{T|Icons|style=plain|block=yes}}</nowiki></code>
| {{T|Icons|style=plain|block=yes}}
|-
| <code><nowiki>{{T|Icons|2=Item1|3=Item2|4=Item3|style=pre|block=yes}}</nowiki></code>
| {{T|Icons|2=Item1|3=Item2|4=Item3|style=pre|block=yes}}
|}

=== Full usage ===
<code><nowiki>
{{T|Icons|2=param1=Item1|3=param2=Item2|4=param3=Item3<br/>...|5=param10=Item10|block=true|style=pre|prefix=subst}}
</nowiki></code>
{{T|Icons|2=param1=Item1|3=param2=Item2|4=param3=Item3<br/>...|5=param10=Item10|block=true|style=pre|prefix=subst}}

== See also ==
* [[w:c:templates:Template:T3|T3]] (uses [[w:c:dev:Global Lua Modules/T|Dev:T]])

<includeonly>[[Category:Internal link templates]]</includeonly>
Please note that all contributions to DOORS Wiki are considered to be released under the Creative Commons Attribution-ShareAlike (see DOORS Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)
Below are some commonly used wiki markup codes. Simply click on what you want to use and it will appear in the edit box above.

View this template