Difference between revisions of "Template:Tag"

From The Battle for Wesnoth Wiki
m (format tweak)
m (Usage: Removing the tt formatting from the examples)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<tt><nowiki>[</nowiki></tt>[[{{{1}}}#.5B{{{2}}}.5D|{{{3|{{{2}}}}}}]]<tt><nowiki>]</nowiki></tt><noinclude>
+
<nowiki>[</nowiki>[[{{{1}}}#.5B{{{2}}}.5D|{{{3|{{{2}}}}}}]]<nowiki>]</nowiki><noinclude>
  
 
== Usage ==
 
== Usage ==
Line 12: Line 12:
 
=== Examples ===
 
=== Examples ===
  
For example, "<tt><nowiki>[</nowiki></tt>[[InternalActionsWML#.5Bset_variables.5D|set_variables]]<tt><nowiki>]</nowiki></tt>", can be produced by
+
For example, "<nowiki>[</nowiki>[[InternalActionsWML#.5Bset_variables.5D|set_variables]]<nowiki>]</nowiki>", can be produced by
 
  <nowiki>{{tag|InternalActionsWML|set_variables}}</nowiki>
 
  <nowiki>{{tag|InternalActionsWML|set_variables}}</nowiki>
while "<tt><nowiki>[</nowiki></tt>[[InternalActionsWML#.5Bset_variables.5D|literal]]<tt><nowiki>]</nowiki></tt>" can be produced by
+
while "<nowiki>[</nowiki>[[InternalActionsWML#.5Bset_variables.5D|literal]]<nowiki>]</nowiki>" can be produced by
 
  <nowiki>{{tag|InternalActionsWML|set_variables|literal}}</nowiki>
 
  <nowiki>{{tag|InternalActionsWML|set_variables|literal}}</nowiki>
 
</noinclude>
 
</noinclude>

Latest revision as of 12:36, 7 April 2012

[[[{{{1}}}#.5B{{{2}}}.5D|{{{2}}}]]]

Usage

This template can be used to insert tags with links to their articles, nicely surrounded by square brackets. This template assumes that the tag is defined in a section whose name is of the form [tag2]. (For other types of links, see {{tag2}}.) If the tag in the section name is the same as the tag to be displayed, this template is used as

{{tag|SomethingWML|tag1}}

where "SomethingWML" is replaced by the name of the destination article and "tag1" is replaced by the name of the tag. If the section name and displayed tag differ, the section name gets specified before the displayed tag, as in the following:

{{tag|SomethingWML|tag2|tag1}}

where "SomethingWML" is replaced by the name of the destination article, "tag2" is replaced by the tag in the section link, and "tag1" is replaced by the tag to be shown on the current page (as the link text).

Examples

For example, "[set_variables]", can be produced by

{{tag|InternalActionsWML|set_variables}}

while "[literal]" can be produced by

{{tag|InternalActionsWML|set_variables|literal}}
This page was last edited on 7 April 2012, at 12:36.