Permanently protected template

Difference between revisions of "Template:Navigation"

From Yugipedia
Jump to: navigation, search
(more vars)
(Clearing after navbox to avoid images getting pushed upwards)
 
(39 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{ #vardefine: $mode | {{ lc: {{{mode|}}} }}
+
{{ #if: {{ #var: $template:navigation }}
}}{{ #vardefine: $name | {{ #if: {{{demo|}}} | {{{demo}}} | {{ #if: {{{name|}}} | {{{name}}} | {{PAGENAME}} }} }}
+
  | [[Category:Pages with multiple ((Navigation)) transclusions]]
}}{{ #vardefine: $display-name | {{ #if: {{{demo|}}} | {{{demo}}} | {{ #if: {{{1|}}} | {{{1}}} | {{ #var: $name }} }} }}
+
  | {{ #ifeq: {{NAMESPACE}} | {{ns:Template}} || {{ #vardefine: $template:navigation | 1 }} }}
}}{{ #vardefine: $ns | {{ #if: {{{demo_ns|}}} | {{{demo_ns}}} | {{ #if: {{{demo|}}} | {{NAMESPACE:{{{demo}}}}} | {{NAMESPACE}} }} }}
+
}}{{ #vardefine: $mode        | {{ lc: {{{mode|}}} }}
}}{{ #vardefine: $show-name | {{ #show: {{PAGENAME}} | ?Page name }}
+
}}{{ #vardefine: $pagename    | {{Normalized pagename|{{PAGENAME}}}}
}}{{Navbox
+
}}{{ #vardefine: $name         | {{ #if: {{{demo|}}} | {{PAGENAME:{{{demo}}}}} | {{ #var: $pagename }} }}
| title      = '''[[{{ #var: $name }}|{{ #var: $display-name }}]]'''
+
}}{{ #vardefine: $ns           | {{ #if: {{{demo|}}} | {{NAMESPACE:{{{demo}}}}} | {{NAMESPACE}} }}
 
+
}}{{ #vardefine: $linked-name  | {{ #show: {{ #var: $name }} |?English name (linked) |default=[[{{ #var: $name }}]] }}
 +
}}{{ #vardefine: $show-name   | {{ #show: {{ #var: $pagename }} | ?Page name }}
 +
}}{{ #ifeq: {{ #var: $ns }} | Card Gallery | __NOTOC__ }}<div class="mobile-show">'''"{{ #var: $linked-name }}"''': {{Card info links|{{ #var: $show-name }}}}</div>{{Navbox
 +
| title      = "{{ #var: $linked-name }}"
 
| navbar    = plain
 
| navbar    = plain
 
| state      = plain
 
| state      = plain
| bodystyle  = width: auto; background: #F9F9F9; padding: 5px 4px; font-size: 90%; margin-bottom: 20px
+
| listclass  = hlist
 +
| 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;
 
| titlestyle = font-size: 95%;
 
| 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) -->
| list1      = {{
+
* {{Related page link|Card Gallery|{{{demo|}}}|label=Gallery}}<!--
    #ifeq: {{ #var: $mode }} | spirit          <!-- spirits don't get galleries -->
+
-->{{ #switch: {{ #var: $mode }}                  <!-- only OCG/TCG cards and Tokens get rulings -->
    || {{Related page link|Card Gallery|{{{demo|}}}|label=Gallery}} -  
+
     | nongame | tip        =  
  }} {{
+
     | #default             =  
    #switch: {{ #var: $mode }}                  <!-- only OCG/TCG cards and Tokens get rulings -->
+
* {{Related page link|Card Rulings|{{{demo|}}}|label=Rulings}} }}<!--
     | nongame | spirit | tip        =  
+
-->{{ #if: {{ #var: $mode }} ||                  <!-- only OCG/TCG cards get errata -->
     | #default                       = {{Related page link|Card Rulings|{{{demo|}}}|label=Rulings}} -  
+
* {{Related page link|Card Errata|{{{demo|}}}|label=Errata}} }}<!--
  }} {{
+
-->{{ #switch: {{ #var: $mode }}                  <!-- tip/strategy cards don't get artworks -->
    #if: {{ #var: $mode }}                     <!-- only OCG/TCG cards get errata -->
+
     | tip                   =  
    || {{Related page link|Card Errata|{{{demo|}}}|label=Errata}} -  
+
     | #default             =  
  }} {{
+
* {{Related page link|Card Artworks|{{{demo|}}}|label=Artworks}} }}<!--
    #switch: {{ #var: $mode }}                  <!-- only OCG/TCG/Bandai/DDM/VG cards get tips -->
+
-->{{ #switch: {{ #var: $mode }}                  <!-- only OCG/TCG/Bandai/DDM/VG cards get tips -->
     | token | nongame | spirit | tip =  
+
     | token | nongame | tip =  
     | #default                       = {{Related page link|Card Tips|{{{demo|}}}|label=Tips}} -  
+
     | #default             =  
  }} {{
+
* {{Related page link|Card Tips|{{{demo|}}}|label=Tips}} }}
    #switch: {{ #var: $mode }}                  <!-- tip/strategy cards don't get appearances -->
+
* {{Related page link|Card Trivia|{{{demo|}}}|label=Trivia}}<!--
     | tip                           =  
+
-->{{ #switch: {{ #var: $mode }}                  <!-- tip/strategy cards don't get appearances -->
     | #default                       = {{Related page link|Card Appearances|{{{demo|}}}|label=Appearances}} -
+
     | tip                   =  
  }} {{Related page link|Card Trivia|{{{demo|}}}|label=Trivia}} {{
+
     | #default             =  
    #switch: {{ #var: $mode }}                  <!-- spirits and tip/strategy cards don't have a linebreak -->
+
* {{Related page link|Card Appearances|{{{demo|}}}|label=Appearances}} }}<!--
    | spirit                        =
+
-->{{ #switch: {{ #var: $mode }}                  <!-- tokens and tip/strategy cards don't get names or lores -->
    | token | tip                    = -
+
     | token | tip           =  
    | #default                      = <br />
+
     | #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]] --> |  
    #switch: {{ #var: $mode }}                  <!-- tokens, spirits, and tip/strategy cards don't get lores -->
+
* {{Related page link|Card Lores|{{{demo|}}}|label=Lores}} }} }}<!--
     | token | spirit | tip           =  
+
-->{{ #if: {{{other|}}} | <br />{{{other|}}}
     | #default                       = {{Related page link|Card Lores|{{{demo|}}}|label=Lores}} -  
+
   }}{{IfSemantics
  }} {{
+
     | {{ #if: {{ #ask: [[Main card page::{{ #var: $pagename }}]] }} | <nowiki/>
    #switch: {{ #var: $mode }}                  <!-- spirits and tip/strategy cards don't get artworks -->
+
{{ #ask: [[Main card page::{{ #var: $pagename }}]]
     | spirit | tip                   =  
+
      |?Medium
     | #default                       = {{Related page link|Card Artworks|{{{demo|}}}|label=Artworks}} {{ #ifeq: {{ #var: $mode }} | token || - }}  
+
      |?Release
  }} {{
+
      |format=ul
    #switch: {{ #var: $mode }}                  <!-- tokens, spirits, and tip/strategy cards don't get names -->
+
      |template=pipeLink
    | token | spirit | tip          =
+
      |link=none
    | #default                      = {{Related page link|Card Names|{{{demo|}}}|label=Names}} {{ #ifeq: {{ #var: $mode }} | nongame || - }}
+
      |sort=Medium
  }} {{
+
      }}
    #switch: {{ #var: $mode }}                 <!-- tokens, spirits, and anime/manga cards don't get sets -->
+
   }} }}
    | token | spirit | nongame      =
 
    | #default                      = {{Related page link|Card Sets|{{{demo|}}}|label=Sets}}
 
  }}{{
 
    #if: {{{Other2|}}}
 
    | {{{Other2}}}
 
   }}{{
 
     #if: {{{Other|}}}
 
    | <br/>{{{Other}}}
 
  }}
 
----
 
'''{{
 
    #switch: {{ #var: $ns }}
 
    | Card Gallery    = Card Galleries
 
    | Card Rulings    = [[Ruling|Card Rulings]]
 
    | Card Errata      = [[Errata|Card Errata]]
 
    | #default        = {{ #var: $ns }}
 
   }} A-Z'''
 
<div style="font-size: 95%;">{{Contents|Category:{{ #var: $ns }}}}</div>
 
 
}}<!--
 
}}<!--
 
 
SMW and categories
 
SMW and categories
 
+
-->[[{{ #var: $ns }} page for::{{ #var: $pagename }}| ]]{{ #switch: {{ #var: $ns }}
-->{{IfSemantics
+
   | {{ns:3004}}<!-- Gallery -->
| [[{{NAMESPACE}} page for::{{PAGENAME}}| ]]
+
   | {{ns:3008}}<!-- Rulings -->
}}{{
+
   | {{ns:3010}}<!-- Errata -->
  #switch: {{NAMESPACE}}
+
   | {{ns:3012}}<!-- Artworks -->
   | {{NS:100}}<!-- Card Gallery     -->
+
   | {{ns:3014}}<!-- Tips -->
   | {{NS:102}}<!-- Card Rulings     -->
+
   | {{ns:3016}}<!-- Trivia -->
   | {{NS:104}}<!-- Card Errata     -->
+
   | {{ns:3018}}<!-- Appearances -->
   | {{NS:106}}<!-- Card Tips        -->
+
   | {{ns:3020}}<!-- Names -->
   | {{NS:108}}<!-- Card Trivia      -->
+
   | {{ns:3022}}<!-- Lores --> = {{ #if: {{{nocat|}}}
   | {{NS:112}}<!-- Card Appearances -->
 
   | {{NS:116}}<!-- Card Lores      -->
 
   | {{NS:118}}<!-- Card Artworks    -->
 
  | {{NS:120}}<!-- Card Names       -->
 
   | {{NS:128}}<!-- Card Sets        --> = {{
 
    #if: {{{nocat|}}}
 
 
     | <!-- suppress content categories -->
 
     | <!-- suppress content categories -->
     | [[Category:{{NAMESPACE}}]]
+
     | [[Category:{{ #var: $ns }}]]
   }}<!-- maintenance cats - these should not be suppressed -->{{IfSemantics|{{
+
   }}<!-- maintenance cats - these should not be suppressed -->{{IfSemantics|{{ #ifeq: {{ #var: $pagename }} | {{ #var: $show-name }}
    #ifeq: {{PAGENAME}} | {{ #var: $show-name }}
+
     | <!-- card page exists at {{ #var: $pagename }} -->
     | <!-- card page exists at {{PAGENAME}} -->
+
    | {{ #if: {{ #var: $show-name }}
    | {{
+
      | {{Mbox
      #if: {{ #pos: {{PAGENAME}} | = }}
+
        | type = move
      | <!-- hack to keep "Damage = Reptile" info pages out of the tracking category -->
+
        | 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 -->
        #if: {{ #var: $show-name }}
 
        | {{Mbox
 
          | type = move
 
          | text = '''This page should be [{{fullurl:Special:MovePage/{{FULLPAGENAMEE}}|wpNewTitle={{urlencode:{{NAMESPACE}}:{{ #var: $show-name }}}}&wpReason={{urlencode:per main page}}&wpLeaveRedirect=0}} renamed]''' to "{{NAMESPACE}}:{{ #var: $show-name }}" per its [[{{ #var: $show-name }}|main card article]].<br />After renaming, please null-edit [{{fullurl:{{NAMESPACE}}:{{ #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 checked|N]]<!-- card page doesn't exist or is redirect -->
 
      }}
 
 
     }}
 
     }}
   }}}}{{
+
   }}}}{{ #ifeq: {{{1|¬}}} | ¬ || [[Category:((Navigation)) transclusions with unnamed parameter]]
    #if: {{{name|¬}}}
+
  }}{{ #ifeq: {{{other|¬}}} | ¬ || [[Category:((Navigation)) transclusions with "other" parameter]]
     || [[Category:Navigation transclusions to be checked|P]]<!-- {{{name}}} used but empty -->
+
  }}{{ #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<!-- everything else -->    = {{
+
   | #default = {{ #switch: {{FULLBASEPAGENAME}}<!-- all other namespaces -->
    #switch: {{FULLPAGENAME}}
+
     | Template:Navigation | Template:Navigation2 | Template:Navigation3 = <!-- no maintenance cats for Template:Navigation et al -->
     | Template:Navigation           | Template:Navigation/doc  | Template:Navigation/sandbox
+
     | #default = [[Category:((Navigation)) transclusions in the wrong namespace]]
    | Template:Navigation/testcases | Template:Navigation2     | Template:Navigation3 = <!-- no maintenance cats for Template:Navigation et al -->
 
     | #default                     = [[Category:Navigation transclusions to be checked|S{{FULLPAGENAME}}]]
 
 
   }}
 
   }}
}}{{
+
}}{{ #if: {{{demo|}}} | [[Category:Navigation demonstrations]]<!-- demo cat -->
  #if: {{{demo|}}}{{{demo_ns|}}}<!-- demo cat -->
+
}}<!--
  | [[Category:Navigation demonstrations]]
+
check for unknown parameters
}}<noinclude>
+
-->{{ #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}}
 
{{documentation}}
 
</noinclude>
 
</noinclude>

Latest revision as of 01:45, 16 April 2024