Difference between revisions of "Template:What If"

Explain xkcd: It's 'cause you're dumb.
Jump to: navigation, search
(for use in the index)
 
m
Line 3: Line 3:
  
 
==Usage==
 
==Usage==
<code><nowiki>{{what if|</nowiki><font color="SeaGreen">'''''article number'''''</font>|<font color="SeaGreen">'''''article title'''''</font><nowiki>}}</nowiki></code>
+
<code><nowiki>{{What If|</nowiki><font color="SeaGreen">'''''article number'''''</font>|<font color="SeaGreen">'''''article title'''''</font><nowiki>}}</nowiki></code>
  
 
It also creates an anchor that can be linked to. Just add <code>#NUMBER</code> or <code>#Title_of_the_Article</code> to the end of an internal link to jump to the position of this template on that page (see example below). You must use underscores instead of spaces and use sentence case: the links are case-sensitive. Especially useful to link to a specific row of the table in [[What If? chapters]], [[what if? (blog)]], and all the [[:Category:Books|What If? book pages]].
 
It also creates an anchor that can be linked to. Just add <code>#NUMBER</code> or <code>#Title_of_the_Article</code> to the end of an internal link to jump to the position of this template on that page (see example below). You must use underscores instead of spaces and use sentence case: the links are case-sensitive. Especially useful to link to a specific row of the table in [[What If? chapters]], [[what if? (blog)]], and all the [[:Category:Books|What If? book pages]].
Line 10: Line 10:
 
Example all by itself:
 
Example all by itself:
  
* <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>|<font color="SeaGreen">'''''Hot Banana'''''</font><nowiki>}}</nowiki></code> results in <code>{{What If|158|Hot Banana}}</code>
  
* '''(not recommended)''' <code><nowiki>{{what if|</nowiki><font color="SeaGreen">'''''158'''''</font><nowiki>}}</nowiki></code> results in <code>{{what if|158}}</code> ㅤ(It links to the same page, but uses the number instead of the optional link text.)
+
* '''(not recommended)''' <code><nowiki>{{What If|</nowiki><font color="SeaGreen">'''''158'''''</font><nowiki>}}</nowiki></code> 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:
 
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>
+
* <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>
  
 
Example anchor links:
 
Example anchor links:

Revision as of 14:59, 8 April 2025

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

Usage

{{What If|article number|article title}}

It also creates an anchor that can be linked to. Just add #NUMBER or #Title_of_the_Article to the end of an internal link to jump to the position of this template on that page (see example below). You must use underscores instead of spaces and use sentence case: the links are case-sensitive. Especially useful to link to a specific row of the table in What If? chapters, what if? (blog), and all the What If? book pages.

Examples

Example all by itself:

  • (not recommended) {{What If|158}} 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.

Example anchor links:

  • But you should change the appearance by piping the link, like this: [[What If? 2#Hot_Banana|Hot Banana from What If? 2]] results in Hot Banana from What If? 2