Template:Plain link/doc: Difference between revisions
meta>Gracefool note re short version |
meta>Ahora Notice; don't add the protocol. |
||
Line 3: | Line 3: | ||
<!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE --> | <!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE --> | ||
This template will allow you to create a local or [[Help:Interwiki linking|interwiki link]] (such as a link to the [[Help:Page history|history of a page]]) on a page without having the [[File:External.svg|10px]] 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. | This template will allow you to create a local or [[Help:Interwiki linking|interwiki link]] (such as a link to the [[Help:Page history|history of a page]]) on a page without having the [[File:External.svg|10px]] 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 == | |||
When you link to a Wikipedia or other Wikimedia project URL, ''omit the preceeding "http:", or "https:"'', so that the URL begins with "//". This allows users to use the protocol they're using currently. | |||
You can use {{tnull|fullurl}} [[H:MW|magicword]] to generate URLs to Wikipedia pages.. | |||
==Examples== | ==Examples== | ||
*<code><nowiki>{{Plain link|url= | *<code><nowiki>{{Plain link|url=//www.wikipedia.org}}</nowiki></code> gives {{Plain link|url=//www.wikipedia.org}} | ||
*<code><nowiki>{{Plain link| | *<code><nowiki>{{Plain link|//www.wikipedia.org Wikipedia}}</nowiki></code> gives {{Plain link|//www.wikipedia.org Wikipedia}} | ||
*<code><nowiki>{{Plain link| | *<code><nowiki>{{Plain link|//www.wikipedia.org | Wikipedia}}</nowiki></code> gives {{Plain link|//www.wikipedia.org|Wikipedia}} | ||
Note that if your url or link title contains an equals sign <code>=</code> you must use named parameters: | Note that if your url or link title contains an equals sign <code>=</code> you must use named parameters: | ||
*<code><nowiki>{{ Plainlink | url= | *<code><nowiki>{{ Plainlink | url=//en.wikipedia.org/w/index.php?title=Equals_sign&oldid=282228764 | name="=" }}</nowiki></code> gives {{Plain link|url=//en.wikipedia.org/w/index.php?title=Equals_sign&oldid=282228764|name="="}} | ||
To be more concise, you can use <code><nowiki>{{scp}}</nowiki></code> and numbers as parameter names e.g. | To be more concise, you can use <code><nowiki>{{scp}}</nowiki></code> and numbers as parameter names e.g. | ||
*<code><nowiki>{{scp|1= | *<code><nowiki>{{scp|1=//en.wikipedia.org/w/index.php?title=Equals_sign&oldid=282228764|2="="}}</nowiki></code> gives the same {{scp|1=//en.wikipedia.org/w/index.php?title=Equals_sign&oldid=282228764|2="="}} | ||
<includeonly> | <includeonly> | ||
<!-- ADD CATEGORIES BELOW THIS LINE --> | <!-- ADD CATEGORIES BELOW THIS LINE --> |
Revision as of 12:05, 23 October 2012
This is a documentation subpage for Template:Plain link. It may contain usage information, categories and other content that is not part of the original template page. |
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
When you link to a Wikipedia or other Wikimedia project URL, omit the preceeding "http:", or "https:", so that the URL begins with "//". This allows users to use the protocol they're using currently.
You can use {{fullurl}}
magicword to generate URLs to Wikipedia pages..
Examples
{{Plain link|url=//www.wikipedia.org}}
gives [1]{{Plain link|//www.wikipedia.org Wikipedia}}
gives Wikipedia{{Plain link|//www.wikipedia.org | Wikipedia}}
gives Wikipedia
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 {{scp}}
and numbers as parameter names e.g.
{{scp|1=//en.wikipedia.org/w/index.php?title=Equals_sign&oldid=282228764|2="="}}
gives the same "="