Difference between revisions of "Template:Chapter"
Dinoguy1000 (talk | contribs) (properly link chapters that don't yet have an article even when SMW is enabled; link to the correct page when SMW is disabled and the chapter number is lower than 100 and has no leading zeros) |
Dinoguy1000 (talk | contribs) ({{{page}}}/{{{4}}} handling doesn't rely on SMW and comes after the rest of the logic in the template, so move it after the main body of code, with its own check) |
||
Line 28: | Line 28: | ||
}}<span class="citation">{{ #if: {{ #if: {{IfSemantics}} | {{ #if: {{ #ask: [[Chapter series::Yu-Gi-Oh! {{ #var: $template:chapter-release }}]][[English chapter number::{{ #var: $template:chapter-number }}]] }} | 1 }} }} | }}<span class="citation">{{ #if: {{ #if: {{IfSemantics}} | {{ #if: {{ #ask: [[Chapter series::Yu-Gi-Oh! {{ #var: $template:chapter-release }}]][[English chapter number::{{ #var: $template:chapter-number }}]] }} | 1 }} }} | ||
| {{ #switch: {{ lc: {{{3}}} }} | | {{ #switch: {{ lc: {{{3}}} }} | ||
− | | ref = <cite>Yu-Gi-Oh! {{ #var: $template:chapter-release }}</cite> {{ #var: $template:chapter-chapter-name }} {{ #var: $template:chapter-number }}: "{{ #ask: [[Chapter series::Yu-Gi-Oh! {{ #var: $template:chapter-release }}]][[English chapter number::{{ #var: $template:chapter-number }}]] |?Translated Japanese chapter name |?English chapter name | link=none | format=template | template=PipeLink }}" | + | | ref = <cite>Yu-Gi-Oh! {{ #var: $template:chapter-release }}</cite> {{ #var: $template:chapter-chapter-name }} {{ #var: $template:chapter-number }}: "{{ #ask: [[Chapter series::Yu-Gi-Oh! {{ #var: $template:chapter-release }}]][[English chapter number::{{ #var: $template:chapter-number }}]] |?Translated Japanese chapter name |?English chapter name | link=none | format=template | template=PipeLink }}" |
| number = {{ #ask: [[Chapter series::Yu-Gi-Oh! {{ #var: $template:chapter-release }}]][[English chapter number::{{ #var: $template:chapter-number }}]] |?English chapter number |link=none |format=template |template=PipeLink }} | | number = {{ #ask: [[Chapter series::Yu-Gi-Oh! {{ #var: $template:chapter-release }}]][[English chapter number::{{ #var: $template:chapter-number }}]] |?English chapter number |link=none |format=template |template=PipeLink }} | ||
| numbers = {{ #ask: [[Chapter series::Yu-Gi-Oh! {{ #var: $template:chapter-release }}]][[English chapter number::{{ #var: $template:chapter-number }}]] |?English chapter number |?Japanese chapter number |link=none |format=template |template=Chapter/numbers }} | | numbers = {{ #ask: [[Chapter series::Yu-Gi-Oh! {{ #var: $template:chapter-release }}]][[English chapter number::{{ #var: $template:chapter-number }}]] |?English chapter number |?Japanese chapter number |link=none |format=template |template=Chapter/numbers }} | ||
Line 36: | Line 36: | ||
| number | numbers = {{ #var: $template:chapter-number }} | | number | numbers = {{ #var: $template:chapter-number }} | ||
| #default = <cite>Yu-Gi-Oh! {{ #var: $template:chapter-release }}</cite> {{ #var: $template:chapter-chapter-name }} {{ #var: $template:chapter-number }} | | #default = <cite>Yu-Gi-Oh! {{ #var: $template:chapter-release }}</cite> {{ #var: $template:chapter-chapter-name }} {{ #var: $template:chapter-number }} | ||
− | }}]]{{ #if: {{{page|}}} | , page #{{{page}}} }}{{ #if: {{{4|}}} | {{;}} {{{4}}} }} | + | }}]] |
− | }}</span></includeonly><noinclude>{{documentation}}</noinclude> | + | }}{{ #ifeq: {{ lc: {{{3}}} }} | ref | {{ #if: {{{page|}}} | , page #{{{page}}} }}{{ #if: {{{4|}}} | {{;}} {{{4}}} }} }}</span></includeonly><noinclude>{{documentation}}</noinclude> |
Revision as of 05:48, 26 December 2015
{{chapter}}
is used to create pre-formatted links to articles on manga chapters.
In the event that the extension Semantic MediaWiki gets disabled, this template has fallback outputs that are different than desired, but don't contain broken code.
Usage
{{chapter|series name|chapter number}}
This is used to provided the name of the chapter, linked to its article.
{{chapter|series name|chapter number|ref}}
This will produce the name of the chapter in reference format, including a link to its article.
{{chapter|series name|chapter number|ref|page=page number}}
This can be used to add the page number to the ref format.
{{chapter|series name|chapter number|number}}
This will produce the number of the chapter, linked to its article.
Examples
Input | Output |
---|---|
{{chapter|Yu-Gi-Oh!|1}} | "The Puzzle of the Gods" |
{{chapter|Yu-Gi-Oh!|1|ref}} | Yu-Gi-Oh! Duel 1: "The Puzzle of the Gods" |
{{chapter|Yu-Gi-Oh!|1|ref|page=5}} | Yu-Gi-Oh! Duel 1: "The Puzzle of the Gods"; page 5 |
{{chapter|Yu-Gi-Oh!|1|number}} | 001 |
Subseries | |
{{chapter|Yu-Gi-Oh!|60|ref}} | Yu-Gi-Oh! Duel 60 (Duelist Duel 1): "Challenge!!" |
{{chapter|Yu-Gi-Oh! Duelist|1|ref}} | Yu-Gi-Oh! Duel 60 (Duelist Duel 1): "Challenge!!" |
{{chapter|Yu-Gi-Oh!|300|ref}} | Yu-Gi-Oh! Duel 300 (Millennium World Duel 22): "Slifer vs. Diabound" |
{{chapter|Yu-Gi-Oh! Millennium World|22|ref}} | Yu-Gi-Oh! Duel 300 (Millennium World Duel 22): "Slifer vs. Diabound" |
Arcs | |
{{chapter|Yu-Gi-Oh! OCG Stories|Sky Striker Ace|1}} | "Sky Striker" |
{{chapter|Yu-Gi-Oh! OCG Stories|Magistus|1|ref}} | Yu-Gi-Oh! OCG Stories Magistus arc chapter 1: "Magistus" |
Special chapters | |
{{chapter|Summon The Dark Ruler!!|ref}} | Yu-Gi-Oh! R Special Duel: "Summon The Dark Ruler!!" |
{{chapter|Yu-Gi-Oh! GX - Chapter SP1|ref}} | Yu-Gi-Oh! GX "Special One-Shot" |
{{chapter|Yu-Gi-Oh! 5D's - Ride SP1|ref}} | Yu-Gi-Oh! 5D's Special Side Story Part 1: "The Duel Emperor Finals!!" |
{{chapter|TRANSCEND GAME (part 2)|ref}} | Yu-Gi-Oh! "TRANSCEND GAME (part 2)" |
{{chapter|Let's Do It! Rush Duel!!|ref}} | Yu-Gi-Oh! SEVENS "Let's Do It! Rush Duel!!" |