Template
Interface template

Card2

From Dogcraft Wiki

mNo edit summary
Tag: Reverted
(Undo revision 31019 by Domino)
Tag: Undo
 
(One intermediate revision by the same user not shown)
Line 2: Line 2:
class="wiki-card {{#if: {{{cover|}}}|card-cover|}} {{#if: {{{overflow|}}}|card-overflow|}} {{#if: {{{title|}}}||card-img-only}}"  
class="wiki-card {{#if: {{{cover|}}}|card-cover|}} {{#if: {{{overflow|}}}|card-overflow|}} {{#if: {{{title|}}}||card-img-only}}"  
style="width:{{{width|120px}}};  
style="width:{{{width|120px}}};  
font-size:{{#if: {{{image-height|}}}|calc({{{image-height|}}} / 5)|{{#if: {{{no-dynamic-img|}}}|16|calc({{{width|120px}}} / 7.5)}}}};">[[File:{{{file|File missing}}}|frameless|{{{width|300px}}}|{{{title|}}}|link={{{link|#}}}]] {{#if:{{{title|}}}|[[{{{link|#}}}|{{{title| }}}]]}}</div></includeonly><noinclude><!--
font-size:{{#if: {{{image-height|}}}|calc({{{image-height|}}} / 5)|calc({{{width|120px}}} / 7.5)}};">[[File:{{{file|File missing}}}|frameless|{{{width|300px}}}|{{{title|}}}|link={{{link|#}}}]] {{#if:{{{title|}}}|[[{{{link|#}}}|{{{title| }}}]]}}</div></includeonly><noinclude><!--


Note: The image-height property uses a CSS hack:  
Note: The image-height property uses a CSS hack:  
Line 154: Line 154:
"default": "#",
"default": "#",
"required": true
"required": true
},
"dynamic-img": {
"label": "Trigger: No Dynamic Image",
"description": "If set to true, image height will always be 80px or is using cover mode, whatever is specified for image-height.",
"example": "true or false",
"type": "boolean",
"default": "false"
}
}
},
},
Line 171: Line 164:
"overflow",
"overflow",
"cover",
"cover",
"dynamic-img",
"image-height"
"image-height"
],
],

Latest revision as of 01:01, 29 June 2023

This template has no relation to Template:Card.

Card template (dogcraft.net styled)

This is an interface template for creating a link card in the style of the main dogcraft.net website. Please check the template parameters before use!

Examples

Default



Guides Cog.svg

Using overflow mode

Using cover mode


DC Courthouse Logo.png

In a flexbox, using cover mode


Template data

Note: The image-height parameter uses a CSS hack, check implementation comments.

A lightweight link card in the style of the main dogcraft.net website

Template parameters

This template prefers block formatting of parameters.

ParameterDescriptionTypeStatus
Filefile

The name of the image to be displayed

Example
Guides Cog.svg or DC Courthouse Logo.png
Filerequired
Linklink

Target page

Default
#
Example
Main Page
Page namerequired
Titletitle

The text to be displayed

Example
Projects
Stringsuggested
Widthwidth

Card width

Default
120px
Stringoptional
Trigger: Overflowoverflow

Decides whether the title can wrap to multiple lines

Default
false
Example
true or false
Booleanoptional
Trigger: Covercover

Decides whether the image covers the entire available area (useful for screenshots) or remains in the center (useful for icons)

Default
false
Example
true or false
Booleanoptional
Image height (requires cover mode)image-height

Sets the height of the image, in pixels (only has effect on cover mode!)

Default
80
Example
200
Numberoptional