Difference between revisions of "Template:Navigation"
Dinoguy1000 (talk | contribs) (quotes on card name; rm superfluous bolding) |
(→top: Restoring revision 5089399 by User:Dinoguy1000 on 2022-10-23 04:35:36. don't add entries to the pagelinks table for nonexistent name/lore pages) (Tag: New user edit) |
||
Line 2: | Line 2: | ||
| [[Category:Pages with multiple ((Navigation)) transclusions]] | | [[Category:Pages with multiple ((Navigation)) transclusions]] | ||
| {{ #ifeq: {{NAMESPACE}} | {{ns:Template}} || {{ #vardefine: $template:navigation | 1 }} }} | | {{ #ifeq: {{NAMESPACE}} | {{ns:Template}} || {{ #vardefine: $template:navigation | 1 }} }} | ||
− | }}{{ #vardefine: $mode | + | }}{{ #vardefine: $mode | {{ lc: {{{mode|}}} }} |
}}{{ #vardefine: $pagename | {{Normalized pagename|{{PAGENAME}}}} | }}{{ #vardefine: $pagename | {{Normalized pagename|{{PAGENAME}}}} | ||
}}{{ #vardefine: $SMW-name | {{ #show: {{ #var: $pagename }} | ?English name }} | }}{{ #vardefine: $SMW-name | {{ #show: {{ #var: $pagename }} | ?English name }} | ||
− | }}{{ #vardefine: $name | {{ #if: {{{demo|}}} | {{{demo | + | }}{{ #vardefine: $name | {{ #if: {{{demo|}}} | {{{demo}}} | {{ #if: {{{1|}}} | {{ #ifeq: {{ #replace: {{{1}}} | # }} | {{ #var: $pagename }} | {{ #replace: {{{1}}} | # }} | {{ #var: $pagename }} }} | {{ #var: $pagename }} }} }} |
}}{{ #vardefine: $display-name | {{ #if: {{{demo|}}} | {{{demo}}} | {{ #if: {{{1|}}} | {{ #explode: {{{1}}} | ( }} | {{ #var: $SMW-name | {{ #var: $name }} }} }} }} | }}{{ #vardefine: $display-name | {{ #if: {{{demo|}}} | {{{demo}}} | {{ #if: {{{1|}}} | {{ #explode: {{{1}}} | ( }} | {{ #var: $SMW-name | {{ #var: $name }} }} }} }} | ||
}}{{ #vardefine: $ns | {{ #if: {{{demo_ns|}}} | {{{demo_ns}}} | {{ #if: {{{demo|}}} | {{NAMESPACE:{{{demo}}}}} | {{NAMESPACE}} }} }} | }}{{ #vardefine: $ns | {{ #if: {{{demo_ns|}}} | {{{demo_ns}}} | {{ #if: {{{demo|}}} | {{NAMESPACE:{{{demo}}}}} | {{NAMESPACE}} }} }} | ||
Line 11: | Line 11: | ||
}}{{ #ifeq: {{ #var: $ns }} | Card Gallery | __NOTOC__ }}<div class="mobile-show">'''[[{{ #var: $name }}|{{ #var: $display-name }}]]'''</div><table class="nomobile" style="width: auto; margin: auto;"><tr><td>{{Navbox | }}{{ #ifeq: {{ #var: $ns }} | Card Gallery | __NOTOC__ }}<div class="mobile-show">'''[[{{ #var: $name }}|{{ #var: $display-name }}]]'''</div><table class="nomobile" style="width: auto; margin: auto;"><tr><td>{{Navbox | ||
| title = "[[{{ #var: $name }}|{{ #var: $display-name }}]]" | | title = "[[{{ #var: $name }}|{{ #var: $display-name }}]]" | ||
− | |||
| navbar = plain | | navbar = plain | ||
| state = plain | | state = plain | ||
| listclass = hlist | | listclass = hlist | ||
− | | bodystyle = | + | | bodystyle = font-size: 90%; margin-bottom: 1em; |
| titlestyle = font-size: 95%; | | titlestyle = font-size: 95%; | ||
− | |||
| list1 = | | list1 = | ||
* {{Related page link|Card Gallery|{{{demo|}}}|label=Gallery}}<!-- | * {{Related page link|Card Gallery|{{{demo|}}}|label=Gallery}}<!-- | ||
Line 41: | Line 39: | ||
-->{{ #switch: {{ #var: $mode }} <!-- tokens and tip/strategy cards don't get names or lores --> | -->{{ #switch: {{ #var: $mode }} <!-- tokens and tip/strategy cards don't get names or lores --> | ||
| token | tip = | | token | tip = | ||
− | | #default = {{ # | + | | #default = {{ #if: {{PROTECTIONEXPIRY:edit|Card Names:{{ #var: $pagename }}}}<!-- [[wikipedia:Template:Linkless exists]] --> | <!-- names/lores pages only get linked to if the page already exists --> |
− | * {{Related page link|Card Names|{{{demo|}}}|label=Names}} }}{{ # | + | * {{Related page link|Card Names|{{{demo|}}}|label=Names}} }}{{ #if: {{PROTECTIONEXPIRY:edit|Card Lores:{{ #var: $pagename }}}}<!-- [[wikipedia:Template:Linkless exists]] --> | |
* {{Related page link|Card Lores|{{{demo|}}}|label=Lores}} }} }}<!-- | * {{Related page link|Card Lores|{{{demo|}}}|label=Lores}} }} }}<!-- | ||
− | -->{{ #if: {{{Other|}}}{{{other|}}} | <br/>{{{Other|}}}{{{other|}}} | + | -->{{ #if: {{{Other|}}}{{{other|}}} | <br />{{{Other|}}}{{{other|}}} |
}}{{IfSemantics | }}{{IfSemantics | ||
− | | {{ #if: {{ #ask: [[Main card page::{{ #var: $pagename }}]] }} | | + | | {{ #if: {{ #ask: [[Main card page::{{ #var: $pagename }}]] }} | <nowiki/> |
− | |||
{{ #ask: [[Main card page::{{ #var: $pagename }}]] | {{ #ask: [[Main card page::{{ #var: $pagename }}]] | ||
|?Medium | |?Medium | ||
Line 58: | Line 55: | ||
}} }} | }} }} | ||
}}</td></tr></table><!-- | }}</td></tr></table><!-- | ||
− | |||
SMW and categories | SMW and categories | ||
− | + | -->[[{{ #var: $ns }} page for::{{ #var: $pagename }}| ]]{{ #switch: {{ #var: $ns }} | |
− | -->{{ #switch: {{ #var: $ns }} | ||
| {{ns:Card Gallery}} | | {{ns:Card Gallery}} | ||
| {{ns:Card Rulings}} | | {{ns:Card Rulings}} | ||
Line 81: | Line 76: | ||
}}[[Category:((Navigation)) transclusions to be renamed]]<!-- card page doesn't exist or is redirect --> | }}[[Category:((Navigation)) transclusions to be renamed]]<!-- card page doesn't exist or is redirect --> | ||
}} | }} | ||
− | }} | + | }}}}{{ #ifeq: {{{1|¬}}} | ¬ || [[Category:((Navigation)) transclusions with unnamed parameter]] |
− | |||
− | |||
− | |||
}}{{ #ifeq: {{{Other|¬}}}{{{other|¬}}} | ¬¬ || [[Category:((Navigation)) transclusions with "other" parameter]] | }}{{ #ifeq: {{{Other|¬}}}{{{other|¬}}} | ¬¬ || [[Category:((Navigation)) transclusions with "other" parameter]] | ||
− | |||
}}{{ #switch: {{ #var: $mode }} | }}{{ #switch: {{ #var: $mode }} | ||
| = <!-- blank or undefined --> | | = <!-- blank or undefined --> |
Revision as of 22:47, 17 March 2023
Usage
This template is used to create the navigation box at the top of Card Gallery, Rulings, Errata, Tips, Appearances, and Trivia pages. Ordinarily, this template can be used just by placing the template call {{Navigation}} on the target page. However, there are some parameters that can be used to influence the final appearance of the navbox.
Examples
{{Navigation}} |
|
{{Navigation|mode=nonGame}} If the card is only found in an anime or manga series or the Yu-Gi-Oh! Duel Monsters promotional cards set, use mode=nonGame to remove Rulings, Tips and Errata links. Shortcut: {{subst:Navigation2}} Note that the shortcut doesn't allow for any additional parameters, such as |other=[[Flame Swordsman (Bandai)|Bandai]]. |
|
{{Navigation|mode=otherGame}} If the card is only found in the Bandai series, Dungeon Dice Monsters or is video game only, you should use mode=otherGame to remove Rulings and Errata links. Shortcut: {{subst:Navigation3}} Note that the shortcut doesn't allow for any additional parameters, such as |other=[[Flame Swordsman (Bandai)|Bandai]]. |
|
{{Navigation|mode=token}} If the card is a token, you should use mode=token to remove the irrelevant links at the top of the box. |
|
{{Navigation|mode=Tip}} if the card is a Tip, Strategy or FAQ card, you should use mode=Tip to remove the Gallery, Rulings, Errata, Anime and Manga Appearances and Tips links at the top of the box. |
|
{{Navigation|other=Other links and information}} If there are any other pages relating to the card, they can be listed using this parameter. |
Tracking categories
{{Navigation}} automatically detects several different possible errors and tracks them in Category:Navigation transclusions to be checked. In additions, uses of the other
parameter are tracked in Category:((Navigation)) transclusions with "other" parameter.