Permanently protected template

Difference between revisions of "Template:Navigation"

From Yugipedia
Jump to: navigation, search
m
(Clearing after navbox to avoid images getting pushed upwards)
 
(125 intermediate revisions by 9 users not shown)
Line 1: Line 1:
{| class="toccolours" style="margin-left: auto; margin-right: auto; margin-top: 2em; margin-bottom: 2em;"
+
{{ #if: {{ #var: $template:navigation }}
|-
+
  | [[Category:Pages with multiple ((Navigation)) transclusions]]
| style="background-color: #ccccff; text-align: center" | '''[[{{ #if: {{{name|}}} | {{{name}}} |{{PAGENAME}}}}{{ #if: {{{1|}}} |{{!}}{{{1}}}}}]]'''
+
  | {{ #ifeq: {{NAMESPACE}} | {{ns:Template}} || {{ #vardefine: $template:navigation | 1 }} }}
|-
+
}}{{ #vardefine: $mode        | {{ lc: {{{mode|}}} }}
| style="font-size: 90%; text-align: center" |
+
}}{{ #vardefine: $pagename    | {{Normalized pagename|{{PAGENAME}}}}
{{ #switch: {{{mode|}}}
+
}}{{ #vardefine: $name        | {{ #if: {{{demo|}}} | {{PAGENAME:{{{demo}}}}} | {{ #var: $pagename }} }}
|token=[[Card Gallery:{{PAGENAME}}|Gallery]] - [[Card Artworks:{{PAGENAME}}|Artworks]]
+
}}{{ #vardefine: $ns          | {{ #if: {{{demo|}}} | {{NAMESPACE:{{{demo}}}}} | {{NAMESPACE}} }}
|nonGame=[[Card Gallery:{{PAGENAME}}|Gallery]] - [[Anime and Manga Appearances:{{PAGENAME}}|Anime & Manga Appearances]] - [[Card Trivia:{{PAGENAME}}|Trivia]]<br/>[[Card Lores:{{PAGENAME}}|Lores]] - [[Card Names:{{PAGENAME}}|Names]] - [[Card Artworks:{{PAGENAME}}|Artworks]]
+
}}{{ #vardefine: $linked-name  | {{ #show: {{ #var: $name }} |?English name (linked) |default=[[{{ #var: $name }}]] }}
|otherGame=[[Card Gallery:{{PAGENAME}}|Gallery]] - [[Card Tips:{{PAGENAME}}|Tips]] - [[Anime and Manga Appearances:{{PAGENAME}}|Anime & Manga Appearances]] - [[Card Trivia:{{PAGENAME}}|Trivia]]<br/>[[Card Lores:{{PAGENAME}}|Lores]] - [[Card Names:{{PAGENAME}}|Names]] - [[Card Artworks:{{PAGENAME}}|Artworks]]
+
}}{{ #vardefine: $show-name    | {{ #show: {{ #var: $pagename }} | ?Page name }}
|spirit=[[Anime and Manga Appearances:{{PAGENAME}}|Anime & Manga Appearances]] - [[Card Trivia:{{PAGENAME}}|Trivia]]
+
}}{{ #ifeq: {{ #var: $ns }} | Card Gallery | __NOTOC__ }}<div class="mobile-show">'''"{{ #var: $linked-name }}"''': {{Card info links|{{ #var: $show-name }}}}</div>{{Navbox
|Tip=[[Card Gallery:{{PAGENAME}}|Gallery]] - [[Card Trivia:{{PAGENAME}}|Trivia]]
+
| title      = "{{ #var: $linked-name }}"
|[[Card Gallery:{{PAGENAME}}|Gallery]] - [[Card Rulings:{{PAGENAME}}|Rulings]] - [[Card Errata:{{PAGENAME}}|Errata]] - [[Card Tips:{{PAGENAME}}|Tips]] - [[Anime and Manga Appearances:{{PAGENAME}}|Anime & Manga Appearances]] - [[Card Trivia:{{PAGENAME}}|Trivia]]<br/>[[Card Names:{{PAGENAME}}|Names]] - [[Card Lores:{{PAGENAME}}|Lores]] - [[Card Artworks:{{PAGENAME}}|Artworks]] }}{{ #if: {{{Other2|}}} |{{{Other2}}} }}{{ #if: {{{Other|}}} |<br/>{{{Other}}} }}
+
| navbar    = plain
{{ #switch: {{{mode|}}} | ----
+
| state      = plain
}}'''{{#switch:{{NAMESPACE}}|Card Gallery=Card Galleries|Card Rulings=[[Ruling|Card Rulings]]|Card Errata=[[Errata|Card Errata]]|Anime and Manga Appearances=Anime & Manga Appearances|{{NAMESPACE}}}} A-Z'''
+
| listclass  = hlist
{{Contents
+
| bodystyle  = width: auto; display: inline-block; position: relative; left: 50%; transform: translateX(-50%);<!-- https://stackoverflow.com/a/5712620/1488311 "Solution without container div" --> font-size: 90%; margin-bottom: 1em;
|info={{NAMESPACE}}
+
| titlestyle = font-size: 95%;
}}
+
| list1      = <!-- TODO: get appropriate data from the card page and pass it to {{Card info links}} (same for the mobile-show links above) -->
|}{{#switch: {{NAMESPACE}} |Template= | {{#ifexist: {{PAGENAME}} | | <includeonly>{{Delete|reason=Automatically flagged for deletion because its main article does not exist}}</includeonly> }} }}<includeonly>[[Extra Pages::{{NAMESPACE}}| ]]</includeonly><noinclude>
+
* {{Related page link|Card Gallery|{{{demo|}}}|label=Gallery}}<!--
 
+
-->{{ #switch: {{ #var: $mode }}                 <!-- only OCG/TCG cards and Tokens get rulings -->
 
+
    | nongame | tip        =
{{documentation}}</noinclude>
+
    | #default              =  
 +
* {{Related page link|Card Rulings|{{{demo|}}}|label=Rulings}} }}<!--
 +
-->{{ #if: {{ #var: $mode }} ||                  <!-- only OCG/TCG cards get errata -->
 +
* {{Related page link|Card Errata|{{{demo|}}}|label=Errata}} }}<!--
 +
-->{{ #switch: {{ #var: $mode }}                 <!-- tip/strategy cards don't get artworks -->
 +
    | tip                  =
 +
    | #default              =
 +
* {{Related page link|Card Artworks|{{{demo|}}}|label=Artworks}} }}<!--
 +
-->{{ #switch: {{ #var: $mode }}                 <!-- only OCG/TCG/Bandai/DDM/VG cards get tips -->
 +
    | token | nongame | tip =
 +
    | #default              =
 +
* {{Related page link|Card Tips|{{{demo|}}}|label=Tips}} }}
 +
* {{Related page link|Card Trivia|{{{demo|}}}|label=Trivia}}<!--
 +
-->{{ #switch: {{ #var: $mode }}                 <!-- tip/strategy cards don't get appearances -->
 +
    | tip                  =
 +
    | #default              =
 +
* {{Related page link|Card Appearances|{{{demo|}}}|label=Appearances}} }}<!--
 +
-->{{ #switch: {{ #var: $mode }}                 <!-- tokens and tip/strategy cards don't get names or lores -->
 +
    | token | tip          =
 +
    | #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}} }}{{ #if: {{PROTECTIONEXPIRY:edit|Card Lores:{{ #var: $pagename }}}}<!-- [[wikipedia:Template:Linkless exists]] --> |
 +
* {{Related page link|Card Lores|{{{demo|}}}|label=Lores}} }} }}<!--
 +
-->{{ #if: {{{other|}}} | <br />{{{other|}}}
 +
  }}{{IfSemantics
 +
    | {{ #if: {{ #ask: [[Main card page::{{ #var: $pagename }}]] }} | <nowiki/>
 +
{{ #ask: [[Main card page::{{ #var: $pagename }}]]
 +
      |?Medium
 +
      |?Release
 +
      |format=ul
 +
      |template=pipeLink
 +
      |link=none
 +
      |sort=Medium
 +
      }}
 +
  }} }}
 +
}}<!--
 +
SMW and categories
 +
-->[[{{ #var: $ns }} page for::{{ #var: $pagename }}| ]]{{ #switch: {{ #var: $ns }}
 +
  | {{ns:3004}}<!-- Gallery -->
 +
  | {{ns:3008}}<!-- Rulings -->
 +
  | {{ns:3010}}<!-- Errata -->
 +
  | {{ns:3012}}<!-- Artworks -->
 +
  | {{ns:3014}}<!-- Tips -->
 +
  | {{ns:3016}}<!-- Trivia -->
 +
  | {{ns:3018}}<!-- Appearances -->
 +
  | {{ns:3020}}<!-- Names -->
 +
  | {{ns:3022}}<!-- Lores --> = {{ #if: {{{nocat|}}}
 +
    | <!-- suppress content categories -->
 +
    | [[Category:{{ #var: $ns }}]]
 +
  }}<!-- maintenance cats - these should not be suppressed -->{{IfSemantics|{{ #ifeq: {{ #var: $pagename }} | {{ #var: $show-name }}
 +
    | <!-- card page exists at {{ #var: $pagename }} -->
 +
    | {{ #if: {{ #var: $show-name }}
 +
      | {{Mbox
 +
        | type = move
 +
        | text = '''This page should be [{{fullurl:Special:MovePage/{{FULLPAGENAMEE}}|wpNewTitle={{urlencode:{{ #var: $ns }}:{{ #var: $show-name }}}}&wpReason={{urlencode:per main page}}&wpLeaveRedirect=0}} renamed]''' to "{{ #var: $ns }}:{{ #var: $show-name }}" per its [[{{ #var: $show-name }}|main card article]].<br />After renaming, please null-edit [{{fullurl:{{ #var: $ns }}:{{ #var: $show-name }}|action=edit}} this page], ''and then'' the [{{fullurl:{{ #var: $show-name }}|action=edit}} main card article], to properly update this notice.
 +
      }}[[Category:((Navigation)) transclusions to be renamed]]<!-- card page doesn't exist or is redirect -->
 +
    }}
 +
  }}}}{{ #ifeq: {{{1|¬}}} | ¬ || [[Category:((Navigation)) transclusions with unnamed parameter]]
 +
  }}{{ #ifeq: {{{other|¬}}} | ¬ || [[Category:((Navigation)) transclusions with "other" parameter]]
 +
  }}{{ #switch: {{ #var: $mode }}
 +
    |           = <!-- blank or undefined -->
 +
    | nongame  = [[Category:((Navigation)) transclusions with "nongame" mode value]]
 +
    | othergame = [[Category:((Navigation)) transclusions with "othergame" mode value]]
 +
    | tip      = [[Category:((Navigation)) transclusions with "tip" mode value]]
 +
    | token    = [[Category:((Navigation)) transclusions with "token" mode value]]
 +
    | #default  = [[Category:((Navigation)) transclusions with unrecognized mode values]]<!-- anything else -->
 +
  }}
 +
  | #default = {{ #switch: {{FULLBASEPAGENAME}}<!-- all other namespaces -->
 +
    | Template:Navigation | Template:Navigation2 | Template:Navigation3 = <!-- no maintenance cats for Template:Navigation et al -->
 +
    | #default = [[Category:((Navigation)) transclusions in the wrong namespace]]
 +
  }}
 +
}}{{ #if: {{{demo|}}} | [[Category:Navigation demonstrations]]<!-- demo cat -->
 +
}}<!--
 +
check for unknown parameters
 +
-->{{ #invoke: check for unknown parameters | check
 +
| unknown = [[Category:((Navigation)) transclusions using unknown parameters]]
 +
| showblankpositional = 1
 +
| preview = unknown <nowiki>{{Navigation}}</nowiki> parameter "_VALUE_"
 +
| 1 | mode | other | nocat | demo
 +
}}{{-}}<noinclude>
 +
{{documentation}}
 +
</noinclude>

Latest revision as of 01:45, 16 April 2024