Template:Pgt/doc
Provides localized title fallback, for use with templates that generate their own links
Usage
{{Pgt |1= }}
{{pgt|pagename}}
Provides the title of the version of a target page in the Commons or Help namespace in the most suitable language that is available. Similar to {{Pg}}, but only outputs a title, not a full link.
If the user is viewing a page in a language other than English and selects a link, they will be taken to a version of the target page in the same language if available, failing that in their preference language, and failing that in English.
- If the current page language is English,
{{pgt|pagename}}
renderspagename
- If the current page language is e.g. French and there is a French version of the target page, renders e.g.
pagename/fr
- Otherwise renders e.g.
Special:MyLanguage/pagename
This will link to a version of the target page in the user's preferred language if available, or in English otherwise.
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
Provides localized title fallback, for use with templates that generate their own links
Parameter | Description | Type | Status | |
---|---|---|---|---|
target | 1 | Translatable page to be linked to | Page name | 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
See also
Localization
This template is not intended to be localized.