Open main menu

Changes

m
no edit summary
{{Documentation subpage}}<!----Categories where indicated at the bottom of this page, please---->

This template adds a formatted MediaWiki parser or extension tag that links to the help or extension page. This template is similar to {{tl|tag}}, but it links the tag and defaults to open.

===Parser and extension tags===
<section begin="xtag" />{{Xtag/list}}<section end="xtag" />

===Parameters===
* '''first parameter''' ''(mandatory)'': the name of the HTML tag
* '''second parameter''': what type of tag to display:
** <code>p</code> or <code>pair</code>: display a matched pair of open-and-close tags
*** To suppress the ellipsis which appears between the tags, add an empty {{para|content}} parameter
** <code>o</code> or <code>open</code> ''(default)'': display only the opening tag of an open-and-close pair
** <code>c</code> or <code>close</code>: display only the closing tag of an open-and-close pair
** <code>s</code> or <code>single</code>: display a single tag
* '''content=''' the text content of the tags
* '''params=''' any parameters to be included in the opening tag

====Examples====
{{markup
|<nowiki>{{xtag|nowiki}}</nowiki>
|{{xtag|nowiki}}
|<nowiki>{{xtag|nowiki|s}}</nowiki>}
|{{xtag|nowiki|s}}
}}

Markup &rarr; Renders as: <br />
<code><nowiki>{{xtag | syntaxhighlight | p | params= enclose="div" lang="text"}}</nowiki> </code>&rarr;<br />
{{xtag | syntaxhighlight | p | params= enclose="div" lang="text"}}

===See also===
* {{tl|tag}}<includeonly>
{{#ifeq:{{SUBPAGENAME}}|sandbox | |
<!----Categories below this line, please:---->
[[Category:Programming typing-aid templates]]
[[Category:Wikipedia XHTML tag-replacing templates| ]]
}}
</includeonly>
Anonymous user