Template:Plain link

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

[{{{url}}}]

Template documentationview · edit · history · purge ]
This documentation is transcluded from Template:Plain link/doc.

This template will allow you to create a local or interwiki link (such as a link to the history of a page) on a page without having the follow the link. This can be used, for example, when internal or interwiki links appear as external links. See Help:URL#URLs on_other Wikimedia projects for more information.

Caution[edit]

When you link to a Wikipedia or other Wikimedia project URL, omit the preceding "http:", or "https:", so that the URL begins with "//". This allows users to use the protocol they're using currently.

You can use the {{fullurl}} magic word to generate URLs to Wikipedia or other web pages....

Examples[edit]

  • {{Plain link|url=//www.wikipedia.org}} gives [1]
  • {{Plain link|//www.wikipedia.org |Wikipedia}} gives Wikipedia
  • {{Plain link|http://en.wikipedia.org |Wikipedia}} gives Wikipedia
  • {{Plain link|http://www.google.co.uk|Google}} gives Google

Note that if your url or link title contains an equals sign = you must use named parameters:

  • {{ Plainlink | url=//en.wikipedia.org/w/index.php?title=Equals_sign&oldid=282228764 | name="=" }} gives "="

To be more concise, you can use {{plnk}} and numbers as parameter names e.g.

  • {{plnk|1=//en.wikipedia.org/w/index.php?title=Equals_sign&oldid=282228764|2="="}} gives the same "="

TemplateData[edit]

<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

Use this template to add a local or interwiki link that would otherwise show a box and arrow icon next to the link without the icon.

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
URLurl URL 1

URL of the link. For Wikimedia links, use the format "//example.com". This allows users to use the protocol they're currently using.

URLrequired
Textname NAME 2

Text to be linked

Stringsuggested