Template:Plainlink/doc: Difference between revisions

From Miranda NG
Jump to navigation Jump to search
Goraf (talk | contribs)
needs to be polished
 
RMN (talk | contribs)
links to wikipedia help pages
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{Documentation subpage}}
{{Documentation subpage}}
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 [[wikipedia:en:Help:Interwiki linking|interwiki link]] (such as a link to the [[wikipedia:en:Help:Page history|history of a page]]) on a page without having the external link icon follow the link. This can be used, for example, when internal or interwiki links appear as external links. See [[wikipedia:en:Help:URL|URLs on other Wikimedia projects]] for more information.


== Caution ==
== Caution ==
Line 6: Line 6:
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 currently using.
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 currently using.


You can use {{tnull|fullurl}} [[Help:Magic words|magicword]] to generate URLs to Wikipedia pages.
You can use {{tnull|fullurl}} [[wikipedia:en:Help:Magic words|magicword]] to generate URLs to Wikipedia pages.


== Examples ==
== Examples ==


*<code><nowiki>{{Plain link|url=//www.wikipedia.org}}</nowiki></code> gives {{Plain link|url=//www.wikipedia.org}}
*<code><nowiki>{{Plainlink|url=//www.wikipedia.org}}</nowiki></code> gives {{Plainlink|url=//www.wikipedia.org}}
*<code><nowiki>{{Plain link|//www.wikipedia.org Wikipedia}}</nowiki></code> gives {{Plain link|//www.wikipedia.org Wikipedia}}
*<code><nowiki>{{Plainlink|//www.wikipedia.org Wikipedia}}</nowiki></code> gives {{Plainlink|//www.wikipedia.org Wikipedia}}
*<code><nowiki>{{Plain link|//www.wikipedia.org | Wikipedia}}</nowiki></code> gives {{Plain link|//www.wikipedia.org|Wikipedia}}
*<code><nowiki>{{Plainlink|//www.wikipedia.org | Wikipedia}}</nowiki></code> gives {{Plainlink|//www.wikipedia.org|Wikipedia}}
*<code><nowiki>{{Plain link|http://www.google.co.uk|Google}}</nowiki></code> gives {{Plain link|http://www.google.co.uk|Google}}
*<code><nowiki>{{Plainlink|http://www.google.co.uk|Google}}</nowiki></code> gives {{Plainlink|http://www.google.co.uk|Google}}


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=//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="="}}
*<code><nowiki>{{ Plainlink | url=//en.wikipedia.org/w/index.php?title=Equals_sign&oldid=282228764 | name="=" }}</nowiki></code> gives {{Plainlink|url=//en.wikipedia.org/w/index.php?title=Equals_sign&oldid=282228764|name="="}}


<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
<!-- Categories go here -->
<!-- Categories go here -->
 
{{Uncategorized}}
}}</includeonly>
}}</includeonly>

Latest revision as of 16:21, 6 December 2015

This is a documentation subpage for Template:Plainlink .
It contains 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 external link icon follow the link. This can be used, for example, when internal or interwiki links appear as external links. See URLs on other Wikimedia projects for more information.

Caution

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 currently using.

You can use Template:Tnull magicword to generate URLs to Wikipedia pages.

Examples

  • {{Plainlink|url=//www.wikipedia.org}} gives [1]
  • {{Plainlink|//www.wikipedia.org Wikipedia}} gives Wikipedia
  • {{Plainlink|//www.wikipedia.org | Wikipedia}} gives Wikipedia
  • {{Plainlink|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 "="