Template:Pgt

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Special:MyLanguage/{{{1}}}

Template documentationview · edit · history · purge ]
This documentation is transcluded from 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}} renders pagename
  • 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>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.

Discussion
There is an ongoing discussion about that matter. Feel invited to comment if you are experienced in either way, your time permits and if you like to share your opinion or to make a suggestion.


Wikipedia's help about TemplateDataCommons-specific information

Provides localized title fallback, for use with templates that generate their own links

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
target1

Translatable page to be linked to

Page namerequired

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.