Difference between revisions of "Template:MapCard"

From comp.tf
Jump to navigation Jump to search
(#ifeq PAGENAME {{{link|}}})
 
(11 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly><div class="mapcard-wrapper" style="display:inline-block; margin:1em 0;">
+
<includeonly>{| style="border:1px solid #aaa; padding:1px; border-spacing:0; margin:1em 0; text-align:center; position:relative; background-color:#f9f9f9"
<center>'''[[{{{1|}}}]]'''</center>
+
|+ style="font-weight:{{#if:{{{notbold|}}}|normal|bold}}" | [[{{{1|}}}]]{{#if:{{{4|}}}|<sup style="font-weight:normal">{{{4|}}}</sup>|}}
<div class="mapcard" style="position:relative; border:1px solid #aaa; padding:2px; background-color:white;">
+
| class="comptf-cardbg mapcard-img" | [[File:{{#if:{{{3|}}}|{{{3|}}}|{{#ifexist:File:{{{1|}}}.jpg|{{{1|}}}.jpg|{{#ifexist:File:{{{1|}}}.png|{{{1|}}}.png}}}}}}|center|150px|link={{#ifeq:{{PAGENAME}}|{{{1|}}}||{{{1|}}}}}]]
<div class="mapcard-caption" style="display:none; position:absolute; width:200px; bottom:0px; line-height:0.8; font-size:12px;">
+
{{#if:{{{2|}}}|<div class="comptf-cardfg" style="display:none; position:absolute; bottom:1px; right:1px; left:1px; background-color:rgba(249,249,249,0.9); padding-bottom:1px"><small><code>{{{2|}}}</code></small></div>|}}
<div style="position:absolute; bottom:0px; left:0px; z-index:1;">[[File:MapCard Caption.png|200px|link={{{1|}}}]]</div>
+
|}</includeonly><noinclude>{{Documentation}}[[Category:Template]][[Category:Templates]]</noinclude>
<div style="position:absolute; bottom:0px; left:0px; z-index:2; height:21px; line-height:21px; vertical-align:middle; margin:0 auto; left:50%; transform:translateX(-50%);">''{{{2|}}}''</div>
 
</div>
 
[[File:{{#if:{{{3|}}}|{{{3|}}}|{{#ifexist:File:{{{1|}}}.jpg|{{{1|}}}.jpg|{{#ifexist:File:{{{1|}}}.png|{{{1|}}}.png}}}}}}|center|200px|link={{{1|}}}]]
 
</div>
 
</div></includeonly><noinclude>{{Documentation}}[[Category:Template]][[Category:Templates]]</noinclude>
 

Latest revision as of 23:26, 28 September 2022

(view - edit) Documentation

Template:MapCard displays a 152x86px rectangular card containing a map image. For a smaller 100x56px image, you can use MapCardSmall.

Usage

{{MapCard |map|filename|image|superscript}}

  • map - name of the map. Displayed as the card's title/caption and image if no image parameter is entered. Is case-sensitive.
  • filename - optional, file name of the map. Displayed upon hovering. All letters should be lowercase.
  • image - optional, image of the map. Will override the image that is automatically shown by the map parameter. Should only be used if the image shown by the map parameter is not appropriate (e.g. shows an error, bad dimensions). Is not case-sensitive.
  • superscript - optional, adds a superscript after the map name. To use, you must also include the image parameter.

Examples

{{MapCard |Mojave}}

Mojave
Mojave.jpg

{{MapCard |Mojave|cp_mojave_b2|Reckoner.jpg|2}}

Mojave2
Reckoner.jpg