Template:Card: Difference between revisions
Template page
More actions
Created page with "Card component of the main page. == TemplateData == <templatedata> { "params": { "class": { "label": "HTML class", "description": "HTML class(es) added to the container", "type": "string" }, "image": { "label": "Background image", "description": "Background image of the card", "example": "John Howe - Gollum.jpg", "type": "wiki-file-name" }, "imagePosition": { "label": "Background image position", "description": "Position of the back..." |
No edit summary |
||
Line 1: | Line 1: | ||
<!-- | |||
Template:Card | |||
< | -------------------- | ||
Create a card | |||
--><includeonly><!-- | |||
--><templatestyles src="Template:Card/styles.css"/><!-- | |||
--><div | |||
class="tg-card {{{class|}}}" | |||
style=" | |||
{{#if:{{{imageColorR|}}}|--tg-card-image-color_r:{{{imageColorR}}};}} | |||
{{#if:{{{imageColorG|}}}|--tg-card-image-color_g:{{{imageColorG}}};}} | |||
{{#if:{{{imageColorB|}}}|--tg-card-image-color_b:{{{imageColorB}}};}} | |||
{{#if:{{{height|}}}|min-height:{{{height}}};}} | |||
"><!-- | |||
-->{{#if:{{{header|}}}|<div class="tg-card-header">{{{header}}}</div>}}<!-- | |||
Image wrapper is needed to content overlay effect | |||
-->{{#if:{{{image|}}}|<div class="tg-card-image">}}<!-- | |||
-->{{#if:{{{image|}}}|<div class="tg-card-background {{#if:{{{imagePosition|}}}|tg-card-background--{{{imagePosition}}}}}">[[File:{{{image}}}|{{{imageWidth|400}}}px|link=]]</div>}}<!-- | |||
-->{{#if:{{{label|}}}|<div class="tg-card-label">{{#if:{{{labelpage|}}}|[[{{{labelpage}}}|{{{label}}}]]|<span>{{{label}}}</span>}}</div>}}<!-- | |||
--><div class="tg-card-content"><!-- | |||
-->{{#if:{{{title|}}}|<div class="tg-card-title">{{{title}}}</div>}}<!-- | |||
-->{{#if:{{{caption|}}}|<div class="tg-card-caption">{{{caption}}}</div>}}<!-- | |||
-->{{#if:{{{content|}}}|<div class="tg-card-body">{{{content}}}</div>}}<!-- | |||
--></div><!-- | |||
-->{{#if:{{{link|}}}|<div class="tg-card-link">[[{{{link}}}]]</div>}}<!-- | |||
-->{{#if:{{{image|}}}|</div>}}<!-- | |||
-->{{#if:{{{afterImage|}}}|<div class="tg-card-afterImage">{{{afterImage}}}</div>}}<!-- | |||
-->{{#if:{{{footer|}}}|<div class="tg-card-footer">{{{footer}}}</div>}}<!-- | |||
--></div><!-- | |||
--></includeonly><!-- | |||
--><noinclude><!-- | |||
Template documentation | |||
---------------------- | |||
-->{{/doc}}<!-- | |||
--></noinclude> | |||
} | |||
</ |
Latest revision as of 00:46, 4 September 2025
Card component of the main page.
TemplateData
Card component of the main page
Parameter | Description | Type | Status | |
---|---|---|---|---|
HTML class | class | HTML class(es) added to the container | String | optional |
Background image | image | Background image of the card
| File | optional |
Background image position | imagePosition | Position of the background image in the card
| String | optional |
Background image width | imageWidth | Width of the background image
| Number | optional |
Label | label | Label of the card
| String | optional |
Title | title | Title text of the card
| String | optional |
Caption | caption | Caption text of the card
| String | optional |
Content | content | HTML or wikitext used as content of the card | Content | optional |
Link | link | Page name of the card that is linked to
| Page name | optional |
After image content | afterImage | HTML or wikitext used as content of the card. It is only used on cards with background image | Content | optional |