Difference between revisions of "Template:w"

Explain xkcd: It's 'cause you're dumb.
Jump to: navigation, search
(Undo revision 88574 by 173.245.50.140 (talk))
(The "at Wikipedia" part is not needed)
 
(10 intermediate revisions by 9 users not shown)
Line 1: Line 1:
<includeonly>[http://www.wikipedia.org/wiki/{{#if:{{{1|}}}|{{{1}}}|{{PAGENAME}}}} {{#if:{{{2|}}}|{{{2}}}|{{#if:{{{1|}}}|{{{1}}}|{{PAGENAME}}}}}}]</includeonly>
+
<includeonly><!--
<noinclude>
+
-->[[wikipedia:<!--
A template to make a link to wikipedia.<!-- For a tag to have "at [[Wikipedia:|Wikipedia]]" without being a link to the page name, use {{Tl|wat}} - this is useful for see-also lists.-->
+
-->{{#if:{{{1|}}}<!--
 +
  -->|{{ucfirst:{{{1}}}}}{{!}}{{{2|{{{1|}}}}}}]]<!--
 +
  -->|{{ucfirst:{{PAGENAME}}}}{{!}}{{PAGENAME}}]]<!--
 +
-->}}<!--
 +
--></includeonly><noinclude>
 +
A template to make a link to Wikipedia.<!-- For a tag to have "at [[Wikipedia:|Wikipedia]]" without being a link to the page name, use {{Tl|wat}} - this is useful for see-also lists.-->
  
 
==Usage==
 
==Usage==
*<nowiki>{{w}}</nowiki> by itself links to the page the article the template substituted to is about.
+
*<code><nowiki>{{w}}</nowiki></code> by itself links to the wikipedia page for the page you use the template on
 
**{{w}}
 
**{{w}}
*<nowiki>{{w|Page}}</nowiki> links to the wikipedia article on "Page"
+
*<code><nowiki>{{w|Page}}</nowiki></code> links to the wikipedia article on "Page"
 
**{{w|Page}}
 
**{{w|Page}}
*<nowiki>{{w|Page|Display}}</nowiki> prints "Display" which links to the wikipedia article on "Page"
+
*<code><nowiki>{{w|Page|Display}}</nowiki></code> prints "Display" which links to the wikipedia article on "Page"
 
**{{w|Page|Display}}
 
**{{w|Page|Display}}
 +
 +
The first character of the link target is automatically capitalized, such that e.g. <code><nowiki>{{w|xkcd}}</nowiki></code> ({{w|xkcd}}) and <code><nowiki>{{w|Xkcd|xkcd}}</nowiki></code> ({{w|Xkcd|xkcd}}) both link to the same URL. (Wikipedia page titles never start with a lowercase character, though {{w|WP:DISPLAYTITLE|they can display with alternative capitalization}}.)
  
 
[[Category:Templates]]
 
[[Category:Templates]]
 
</noinclude>
 
</noinclude>

Latest revision as of 10:26, 29 August 2023

A template to make a link to Wikipedia.

Usage

  • {{w}} by itself links to the wikipedia page for the page you use the template on
  • {{w|Page}} links to the wikipedia article on "Page"
  • {{w|Page|Display}} prints "Display" which links to the wikipedia article on "Page"

The first character of the link target is automatically capitalized, such that e.g. {{w|xkcd}} (xkcd) and {{w|Xkcd|xkcd}} (xkcd) both link to the same URL. (Wikipedia page titles never start with a lowercase character, though they can display with alternative capitalization.)