Difference between revisions of "Template:what if"

Explain xkcd: It's 'cause you're dumb.
Jump to: navigation, search
m (Protected "Template:what if": High traffic page (‎[edit=autoconfirmed] (indefinite) ‎[move=autoconfirmed] (indefinite)))
(Cleaned it up and added examples. Also went from http to https)
Line 1: Line 1:
<includeonly>[http://what-if.xkcd.com/{{{1|}}} {{{2|what if {{{1|}}}}}}][[Category:Links to xkcd.com]]</includeonly><noinclude>
+
<includeonly>[https://what-if.xkcd.com/{{{1|}}} {{{2|what if {{{1|}}}}}}][[Category:Links to xkcd.com]]</includeonly><noinclude>
  
This template provides a shortcut markup for creating a link to the actual xkcd.com site.
+
This template provides a shortcut markup for creating a link to a ''[[what if? (blog)|what if?]]'' article on [https://xkcd.com xkcd.com].
  
'''Usage:''' <nowiki>{{what if|question number|optional link text}}</nowiki>
+
'''Usage:''' <code><nowiki>{{what if|question number|optional link text}}</nowiki></code>
  
 
'''Examples:'''
 
'''Examples:'''
:<nowiki>{{what if|100}}</nowiki> results in [http://what-if.xkcd.com/100/ 100]
 
:<nowiki>{{what if|100|WWII Films}}</nowiki> results in [http://what-if.xkcd.com/100/ WWII Films] (links to the same page, but with the link text "WWII Films" instead of "100").
 
  
Note that the styling of the links (the icon after them) is defined in [[MediaWiki:Common.css]].
+
* <code><nowiki>{{what if|</nowiki><font color="SeaGreen">'''''158'''''</font>|<font color="SeaGreen">'''''Hot Banana'''''</font><nowiki>}}</nowiki></code> results in: <code>{{what if|158|Hot Banana}}</code>
 +
 
 +
* <code><nowiki>{{what if|</nowiki><font color="SeaGreen">'''''158'''''</font><nowiki>}}</nowiki></code> '''(not recommended)''' results in <code>{{what if|158}}</code>. It links to the same page, but uses the number instead of the optional link text.
 +
 
 +
Example in a sentence:
 +
 
 +
<code><nowiki>See the ''[[what if? (blog)|what if?]]'' article ''{{what if|</nowiki><font color="SeaGreen">'''''158'''''</font>|<font color="SeaGreen">'''''Hot Banana'''''</font><nowiki>}}''.</nowiki></code> results in <code>See the ''[[what if? (blog)|what if?]]'' article ''{{what if|158|Hot Banana}}''.</code>
  
 
[[Category:Templates]]
 
[[Category:Templates]]
 
</noinclude>
 
</noinclude>

Revision as of 10:32, 27 July 2023


This template provides a shortcut markup for creating a link to a what if? article on xkcd.com.

Usage: {{what if|question number|optional link text}}

Examples:

  • {{what if|158|Hot Banana}} results in: Hot Banana
  • {{what if|158}} (not recommended) results in what if 158. It links to the same page, but uses the number instead of the optional link text.

Example in a sentence:

See the ''[[what if? (blog)|what if?]]'' article ''{{what if|158|Hot Banana}}''. results in See the what if? article Hot Banana.