Difference between revisions of "Template:w"

Explain xkcd: It's 'cause you're dumb.
Jump to: navigation, search
 
(12 intermediate revisions by 3 users not shown)
Line 2: Line 2:
 
-->[[wikipedia:<!--
 
-->[[wikipedia:<!--
 
  -->{{#if:{{{1|}}}<!--
 
  -->{{#if:{{{1|}}}<!--
   -->|{{{1}}}{{!}}{{{2|{{{1|}}}}}}]]<!--
+
   -->|{{ucfirst:{{{1}}}}}{{!}}<span title="{{ucfirst:{{{1}}}}} on Wikipedia">{{{2|{{{1}}}}}}</span>]]<!--
   -->|{{PAGENAME}}{{!}}{{PAGENAME}}]] at  [[wikipedia:|Wikipedia]]<!--
+
   -->|{{ucfirst:{{PAGENAME}}}}{{!}}<span title="{{ucfirst:{{PAGENAME}}}} on Wikipedia">{{PAGENAME}}</span>]]<!--
 
  -->}}<!--
 
  -->}}<!--
--></includeonly>
+
--></includeonly><noinclude>
 +
A template to make a link to Wikipedia.
  
<noinclude>
+
==Usage==
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.-->
+
<code><nowiki>{{w}}</nowiki></code> by itself links to the Wikipedia page for the page you use the template on
 +
*{{w}}
 +
<code><nowiki>{{w|Name}}</nowiki></code> links to the Wikipedia article on "Name"
 +
*{{w|Name}}
 +
<code><nowiki>{{w|Name|Display}}</nowiki></code> prints "Display" which links to the Wikipedia article on "Name"
 +
*{{w|Name|Display}}
  
==Usage==
+
The first character of the {{w|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}}.) [https://xkcd.com xkcd.com]
*<code><nowiki>{{w}}</nowiki></code> by itself links to the wikipedia page for the page you use the template on
 
**{{w}}
 
*<code><nowiki>{{w|Page}}</nowiki></code> links to the wikipedia article on "Page"
 
**{{w|Page}}
 
*<code><nowiki>{{w|Page|Display}}</nowiki></code> prints "Display" which links to the wikipedia article on "Page"
 
**{{w|Page|Display}}
 
  
 
[[Category:Templates]]
 
[[Category:Templates]]
 
</noinclude>
 
</noinclude>

Latest revision as of 09:16, 27 July 2025

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|Name}} links to the Wikipedia article on "Name"

{{w|Name|Display}} prints "Display" which links to the Wikipedia article on "Name"

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.) xkcd.com