Difference between revisions of "Template:Card info links"
Dinoguy1000 (talk | contribs) (don't display a link to the names/lores pages unless they exist (or are forced to display)) |
Dinoguy1000 (talk | contribs) (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 | + | }}{{ #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 | + | }}{{ #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> |