Template:Article
This template is used for linking directly to a what if? article on xkcd.com in the first column of the what if? articles index, or for labelling a book-only chapter that has no online article. For linking to a what if? article or book chapter in an explanation, use {{what if}}.
Usage[edit]
{{what if|article number|article title}}
Or, to link to the chapter of one of the What If? books, add the book number and a hyphen (-) before the chapter number:
{{what if|book numberโchapter number|article title}}
The book numbers are as follows:
1corresponds to the first What If? (book)2corresponds to What If? 23corresponds to What If? 10th Anniversary Edition, the third book in the series. This book only has one chapter, which is what if? 3-70
If the second parameter (article title) is omitted, the entry is treated as a book-only chapter that was never published online: the text is shown bolded and centred, without a link, and without a thumbnail, since there is no online article or image to point to. This is the intended way to reference such chapters, rather than something to avoid.
When the article title is given, a thumbnail of the article's image is shown below the link by default, using the title as the image filename. The image is assumed to be a .png file, so only the base name is needed. To suppress the thumbnail, pass noimage=yes:
{{what if|article number|article title|noimage=yes}}
To use a different image filename, add it as the third parameter (without the File: prefix or the .png extension):
{{what if|article number|article title|image file name}}
To also set a custom thumbnail width in pixels, add it as the fourth parameter (just the number, no px). Note that the third parameter is required in this case, even if it is the same as the title:
{{what if|article number|article title|image file name|width in pixels}}
The width defaults to 100px if omitted.
It also creates a unique anchor that can be linked to. Just add #ARTICLE_NUMBER (or #BOOK_NUMBER-CHAPTER_NUMBER for book chapters) or #Title_of_the_Article (only available if a title was given) to the end of an internal link to jump to the position of this template on that page (see the examples below). Note that you must use underscores instead of spaces and use sentence case, because the links are case-sensitive. Especially useful to link to a specific row of the table in what if? articles, what if? (blog), and all the What If? book pages.
Examples[edit]
Example with an online article:
{{what if|158|Hot Banana}}results in Hot Banana- To link to the 63rd chapter of the second book (which is What If? 2):
{{what if|2-63|Walking on the Sun}}results in Walking on the Sun
Example with a book-only chapter:
{{what if|3-70}}results in what if? 3-70 (It links to the same page, but uses the number instead of the optional link text, and no thumbnail is shown.)
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 with a thumbnail:
{{what if|2|SAT Guessing}}shows the default 100px thumbnail using "SAT Guessing" as the filename.- To suppress it:
{{what if|2|SAT Guessing|noimage=yes}} - To shrink it to 30px (passing the title again as the third parameter since a custom width requires it):
{{what if|2|SAT Guessing|SAT Guessing|30}}
Example anchor links:
[[What If? 2#158]]results in What If? 2#158[[What If? 2#Hot_Banana]]results in What If? 2#Hot_Banana- You can change the appearance by piping the link:
[[What If? 2#Hot_Banana|Hot Banana from What If? 2]]results in Hot Banana from What If? 2