Jump to content

Template:Xtag

From Wikimedia Commons, the free media repository

‎<tag>

Template documentation[ view · edit · history · purge ]
This documentation is transcluded from Template:Xtag/doc.

MediaWiki e[x]tension [tag] link template.

Usage

{{Xtag |1= |2= |params= |content= }}

Template parameters

<templatedata>JSON</templatedata> ./. {{TemplateBox}}
TemplateData

TemplateData is a way to store information about template parameters (the description of those and of the whole template) for both humans and machines. It is used by VisualEditor and possibly other tools like Upload Wizard.


Existing template documentation
At Wikimedia Commons, it is recommended to use {{TemplateBox}} with either ‎useTemplateData=1 or ‎useTemplateData=only on the ‎/doc subpage and transcluding it with {{Documentation}} into the template. ‎<nowiki>-tags can be wrapped around the arguments, if required, to avoid templates being expanded.

Newly created template documentation and imports
Another option, especially for imported templates, or for users with JSON experience, is placing raw ‎<templatedata>-tags into the Wikitext of the template, as described in various Wikipediae.


Wikipedia's help about TemplateDataCommons-specific information

MediaWiki Extension Tag link template

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
Name1

The name of the Extension tag.

Default
tag
Example
nowiki
Linerequired
Type2

The tag type, possible values: “p”/“pair” – “<tag>...</tag>”; “o”/“open” – “<tag>”; “c”/“close” – “</tag>”; “s”/“single” – “<tag />”

Default
open
Stringoptional
Attributesparams

Attributes for the opening tag; ignored when type is “close”.

Example
{{attr|foo|"bar"}}
Contentsuggested
Contentcontent

The text content of the tag; ignored when type is “single”. Default: “...” for “pair” type and empty for other types.

Default
...
Contentsuggested
Plain?plain

Avoid using <code> style.

Default
0
Auto value
1
Booleanoptional
Wrap?wrap

Whether to allow wrapping of the whole tag's contents.

Default
0
Auto value
1
Booleanoptional
No Wrap Name?nowrapname

Whether to add “<span style="white-space:nowrap">” around the tag name.

Default
1
Auto value
0
Booleanoptional
Edit parameter translations

Additional information

The template is intended to be used in the following namespaces: all namespaces

The template is intended to be used by the following user groups: all users

See also