Difference between revisions of "Template:what if"
m |
|||
| (26 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
| − | <includeonly> | + | <includeonly><span id="{{{1|}}}"></span><span id="{{{2|}}}"></span><span class="plainlinks">[[What If? chapters#{{{1|}}}{{!}}{{{2|''what if?'' {{{1|}}}}}}]]</span></includeonly><noinclude> |
| + | This template provides a shortcut markup for creating a link to a ''[[what if? (blog)|what if?]]'' article in our index. | ||
| − | + | ==Usage== | |
| + | <code><nowiki>{{what if|</nowiki><font color="SeaGreen">'''''article number'''''</font>|<font color="SeaGreen">'''''article title'''''</font><nowiki>}}</nowiki></code> | ||
| − | + | It also creates a unique 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 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? chapters]], [[what if? (blog)]], and all the [[:Category:Books|What If? book pages]]. | |
| − | + | ==Examples== | |
| − | : | + | 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> | |
| + | |||
| + | * '''(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: | ||
| + | |||
| + | * <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: | ||
| + | * <code><nowiki>[[What If? 2</nowiki><font color="SeaGreen">'''''#158'''''</font>]]</code> results in [[What If? 2#158]] | ||
| + | |||
| + | * <code><nowiki>[[What If? 2</nowiki><font color="SeaGreen">'''''#Hot_Banana'''''</font>]]</code> results in [[What If? 2#Hot_Banana]] | ||
| + | |||
| + | * But you should change the appearance by piping the link, like this: <code><nowiki>[[What If? 2</nowiki><font color="SeaGreen">'''''#Hot_Banana'''''</font>|Hot Banana from What If? 2]]</code> results in [[What If? 2#Hot_Banana|Hot Banana from What If? 2]] | ||
[[Category:Templates]] | [[Category:Templates]] | ||
</noinclude> | </noinclude> | ||
Latest revision as of 10:26, 12 April 2025
This template provides a shortcut markup for creating a link to a what if? article in our index.
Usage
{{what if|article number|article title}}
It also creates a unique 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 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? chapters, what if? (blog), and all the What If? book pages.
Examples
Example all by itself:
-
{{what if|158|Hot Banana}}results inHot Banana
- (not recommended)
{{what if|158}}results inwhat 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 inSee the what if? article Hot Banana.
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
- 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
