Difference between revisions of "Template:w"
(Added Wikipedia icon) |
|||
| Line 3: | Line 3: | ||
-->{{#if:{{{1|}}}<!-- | -->{{#if:{{{1|}}}<!-- | ||
-->|{{ucfirst:{{{1}}}}}{{!}}{{{2|{{{1|}}}}}}]]<!-- | -->|{{ucfirst:{{{1}}}}}{{!}}{{{2|{{{1|}}}}}}]]<!-- | ||
| − | -->|{{ucfirst:{{PAGENAME}}}}{{!}}{{PAGENAME}}]]<!-- | + | -->|{{ucfirst:{{PAGENAME}}}}{{!}}{{PAGENAME}}]] [[File:Wikipedia's W.png|link=|alt=]]<!-- |
-->}}<!-- | -->}}<!-- | ||
--></includeonly><noinclude> | --></includeonly><noinclude> | ||
| Line 9: | Line 9: | ||
==Usage== | ==Usage== | ||
| − | + | <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}} | |
| − | 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}}.) | + | 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] |
[[Category:Templates]] | [[Category:Templates]] | ||
</noinclude> | </noinclude> | ||
Revision as of 09:42, 18 May 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
