Abrir menu principal

UESPWiki β

Alterações

Predefinição:NamespaceText/Doc

1 378 bytes adicionados, 05h52min de 4 de março de 2014
m
Parameters: Update
== Summary ==
This template allows different text to be used in different namespaces without having to use cumbersome <nowiki>{{#if:...}} or {{#switch:...}}</nowiki> statements. Note, however, that unlike a <nowiki>{{#switch:...}}</nowiki> statement, you ''must'' specify custom text in each namespace, so switches may be the better choice in some instances.

You can also use {{tl|Nst}} as a shortcut.

== Parameters ==
{{Parameters
|1|optional|The default text to display. Can be empty or omitted if nothing should be displayed by default.
|''(Namespace<br>Name or ID)''|optional|Namespace-specific text to display.
}}

== Examples ==
<pre>{{NamespaceText|Example|OB=Oblivion Example|Skyrim=Skyrim Example|Template=Template Example}}</pre>
{{NamespaceText|Example|OB=Oblivion Example|Skyrim=Skyrim Example|Template=Template Example}}


Here, on the other hand, a switch would be shorter (though perhaps less readable):
<pre>{{Nst|Base text|OB=Custom text|SI=Custom text|SR=Custom text|DB=Custom text|Template=Custom text}}

{{#switch:{{NS_ID}}|OB|SI|SR|DB|Template=Custom text|Base text}}</pre>
{{Nst|Base text|OB=Custom text|SI=Custom text|SR=Custom text|DB=Custom text|Template=Custom text}}

{{#switch:{{NS_ID}}|OB|SI|SR|DB|Template=Custom text|Base text}}

<includeonly>[[Category:Content Templates]]</includeonly><noinclude>[[Category:Template Documentation]]</noinclude>
49 382
edições