Permanently protected template

Difference between revisions of "Template:Card info links"

From Yugipedia
Jump to: navigation, search
(don't display a link to the names/lores pages unless they exist (or are forced to display))
(allow the div to be suppressed with wrapper=no)
Line 22: Line 22:
 
}}{{ #arrayintersect: @cil-display | @cil-pages | @cil-type | @cil-medium | @cil-names-lores <!-- only links which are allowed by the specified type + medium get displayed -->
 
}}{{ #arrayintersect: @cil-display | @cil-pages | @cil-type | @cil-medium | @cil-names-lores <!-- only links which are allowed by the specified type + medium get displayed -->
 
}}{{ #arraydefine: @cil-forbidden <!-- force non-display of a given link, regardless of card type or medium -->
 
}}{{ #arraydefine: @cil-forbidden <!-- force non-display of a given link, regardless of card type or medium -->
   | {{ #ifeq: {{{gallery}}} | no | Gallery,
+
   | {{ #ifeq: {{{gallery}}}         | no                                                             | Gallery,
     }}{{ #ifeq: {{{rulings}}} | no | Rulings,  
+
     }}{{ #ifeq: {{{rulings}}}       | no                                                             | Rulings,  
     }}{{ #ifeq: {{{errata}}} | no | Errata,
+
     }}{{ #ifeq: {{{errata}}}       | no                                                             | Errata,
     }}{{ #ifeq: {{{artworks}}} | no | Artworks,
+
     }}{{ #ifeq: {{{artworks}}}     | no                                                             | Artworks,
     }}{{ #ifeq: {{{tips}}} | no | Tips,
+
     }}{{ #ifeq: {{{tips}}}         | no                                                             | Tips,
     }}{{ #ifeq: {{{trivia}}} | no | Trivia,
+
     }}{{ #ifeq: {{{trivia}}}       | no                                                             | Trivia,
     }}{{ #ifeq: {{{appearances}}} | no | Appearances,
+
     }}{{ #ifeq: {{{appearances}}}   | no                                                             | Appearances,
     }}{{ #if: {{ #ifeq: {{{names}}} | no | 1 }}{{ #ifexist: Card Names:{{ #var: $cil-link }} || 1 }} | Names,<!-- names link doesn't display if it doesn't exist, unless names=yes -->
+
     }}{{ #if: {{ #ifeq: {{{names}}} | no | 1 }}{{ #ifexist: Card Names:{{ #var: $cil-link }} || 1 }} | Names,<!-- names link isn't shown if page doesn't exist, unless names=yes -->
     }}{{ #if: {{ #ifeq: {{{lores}}} | no | 1 }}{{ #ifexist: Card Lores:{{ #var: $cil-link }} || 1 }} | Lores<!-- lores link doesn't display if it doesn't exist, unless lores=yes -->
+
     }}{{ #if: {{ #ifeq: {{{lores}}} | no | 1 }}{{ #ifexist: Card Lores:{{ #var: $cil-link }} || 1 }} | Lores<!-- lores link isn't shown if page doesn't exist, unless lores=yes -->
 
   }}
 
   }}
 
}}{{ #arraydiff: @cil-display | @cil-display | @cil-forbidden <!-- diff -->
 
}}{{ #arraydiff: @cil-display | @cil-display | @cil-forbidden <!-- diff -->
 
}}{{ #arraydefine: @cil-required <!-- force display of a given link, regardless of card type or medium -->
 
}}{{ #arraydefine: @cil-required <!-- force display of a given link, regardless of card type or medium -->
   | {{ #ifeq: {{{gallery}}} | yes | Gallery,
+
   | {{ #ifeq: {{{gallery}}}       | yes | Gallery,
     }}{{ #ifeq: {{{rulings}}} | yes | Rulings,  
+
     }}{{ #ifeq: {{{rulings}}}     | yes | Rulings,  
     }}{{ #ifeq: {{{errata}}} | yes | Errata,
+
     }}{{ #ifeq: {{{errata}}}     | yes | Errata,
     }}{{ #ifeq: {{{artworks}}} | yes | Artworks,
+
     }}{{ #ifeq: {{{artworks}}}   | yes | Artworks,
     }}{{ #ifeq: {{{tips}}} | yes | Tips,
+
     }}{{ #ifeq: {{{tips}}}       | yes | Tips,
     }}{{ #ifeq: {{{trivia}}} | yes | Trivia,
+
     }}{{ #ifeq: {{{trivia}}}     | yes | Trivia,
 
     }}{{ #ifeq: {{{appearances}}} | yes | Appearances,
 
     }}{{ #ifeq: {{{appearances}}} | yes | Appearances,
     }}{{ #ifeq: {{{names}}} | yes | Names,
+
     }}{{ #ifeq: {{{names}}}       | yes | Names,
     }}{{ #ifeq: {{{lores}}} | yes | Lores
+
     }}{{ #ifeq: {{{lores}}}       | yes | Lores
 
   }}
 
   }}
 
}}{{ #arraymerge: @cil-display | @cil-display | @cil-required <!-- merge -->
 
}}{{ #arraymerge: @cil-display | @cil-display | @cil-required <!-- merge -->
Line 48: Line 48:
 
}}{{ #arrayintersect: @cil-display | @cil-pages | @cil-display <!-- ensure that @cil-display keeps the canonical link order -->
 
}}{{ #arrayintersect: @cil-display | @cil-pages | @cil-display <!-- ensure that @cil-display keeps the canonical link order -->
 
}}{{ #ifexpr: {{ #arraysize: @cil-display }} > 0 <!-- output nothing if no links are to be displayed -->
 
}}{{ #ifexpr: {{ #arraysize: @cil-display }} > 0 <!-- output nothing if no links are to be displayed -->
   | <div class="hlist" style="text-align: center;">{{ #arrayprint: @cil-display || $link | <nowiki/>
+
   | {{ #if: {{{wrapper|}}} || <div class="hlist" style="text-align: center;"> }}{{ #arrayprint: @cil-display || $link | <nowiki/>
 
* {{Related page link| Card $link | {{ #var: $cil-link }} | label = $link }}
 
* {{Related page link| Card $link | {{ #var: $cil-link }} | label = $link }}
 
}}
 
}}
</div>
+
{{ #if: {{{wrapper|}}} || </div> }}
 
}}<noinclude>
 
}}<noinclude>
 
{{Documentation}}
 
{{Documentation}}
 
</noinclude>
 
</noinclude>

Revision as of 17:52, 31 August 2018