Template:Anchor/doc: Difference between revisions
More actions
use {{TemplateBox}}, remove interlanguage links that are same as on Wikidata |
add description, use TemplateData, remove dead interlanguage link |
||
| Line 9: | Line 9: | ||
|name = anchor | |name = anchor | ||
|desc | |desc-en = This template creates an anchor where it is placed, that is, a point which can be linked like a section header either from somewhere within that page, another Commons page, or another website. It has no visual output. | ||
|namespace = all | |namespace = all | ||
|usergroup = all | |usergroup = all | ||
| Line 34: | Line 34: | ||
|relieson = | |relieson = | ||
|mustbesubst = | |mustbesubst = | ||
|useTemplateData = only | |||
}}<includeonly> | }}<includeonly> | ||
[[Category:Formatting templates]] | [[Category:Formatting templates]] | ||
| Line 40: | Line 41: | ||
[[eo:Ŝablono:Ankro2]] | [[eo:Ŝablono:Ankro2]] | ||
[[ja:Template:Anchor]] | [[ja:Template:Anchor]] | ||
</includeonly> | </includeonly> | ||
Revision as of 20:23, 22 June 2019
This template creates an anchor where it is placed, that is, a point which can be linked like a section header either from somewhere within that page, another Commons page, or another website. It has no visual output.
Usage
{{anchor |anchor= }}
1. {{anchor|foo}}
- could be linked to with [[#foo|...]] from within the same article,
- or it could be linked to with [[articlename#foo|…]] from other articles and from redirects.
2. Anchors can be more suitable for inter-article linking than section titles are. For example,
=={{anchor|foo}}Section title ==- Here, links via [[articlename#foo]] would remain valid even if the section were renamed.
Template parameters
- 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 TemplateData • Commons-specific information
This template creates an anchor where it is placed, that is, a point which can be linked like a section header either from somewhere within that page, another Commons page, or another website. It has no visual output.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| anchor text | anchor 1 | The text that will be the anchor
| Line | required |
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
Localization
This template is not intended to be localized.