Template:Card: Difference between revisions
Created page with "<div style="background: #fff; border: 1px solid #ddd; border-radius: 4px; padding: 18px; box-shadow: 0 1px 3px rgba(0,0,0,0.08);">{{#if:{{{icon|}}}|<div style="font-size: 1.4em; margin-bottom: 6px;">{{{icon}}}</div>}}'''[[{{{1}}}|{{{1}}}]]'''{{#if:{{{desc|}}}|<div style="color: #666; font-size: 0.9em; margin-top: 4px;">{{{desc}}}</div>}}</div><noinclude> == Usage == <pre> {{Card|Page Name}} {{Card|Page Name|icon=🌾|desc=Short description of the page.}} </pre> '''Parame..." |
No edit summary |
||
| Line 1: | Line 1: | ||
<div style="background: #fff; border: 1px solid #ddd; border-radius: 4px; padding: 18px; box-shadow: 0 1px 3px rgba(0,0,0,0.08);">{{#if:{{{icon|}}}|<div style="font-size: 1.4em; margin-bottom: 6px;">{{{icon}}}</div>}}'''[[{{{1}}}|{{{1}}}]]'''{{#if:{{{desc|}}}|<div style="color: #666; font-size: 0.9em; margin-top: 4px;">{{{desc}}}</div>}}</div><noinclude> | <div style="background: #fff; border: 1px solid #ddd; border-radius: 4px; padding: 18px; box-shadow: 0 1px 3px rgba(0,0,0,0.08);">{{#if:{{{image|}}}|<div style="width: 100%; height: 120px; overflow: hidden; border-radius: 4px; margin-bottom: 10px;"><img src="{{filepath:{{{image}}}}}" style="width: 100%; height: 100%; object-fit: cover; display: block;" /></div>|{{#if:{{{icon|}}}|<div style="font-size: 1.4em; margin-bottom: 6px;">{{{icon}}}</div>}}}}'''[[{{{1}}}|{{{1}}}]]'''{{#if:{{{desc|}}}|<div style="color: #666; font-size: 0.9em; margin-top: 4px;">{{{desc}}}</div>}}</div><noinclude> | ||
== Usage == | == Usage == | ||
<pre> | <pre> | ||
{{Card|Page Name}} | {{Card|Page Name}} | ||
{{Card|Page Name|icon=🌾|desc=Short description of the page.}} | {{Card|Page Name|icon=🌾|desc=Short description of the page.}} | ||
{{Card|Page Name|image=some-file.jpg|desc=Short description of the page.}} | |||
</pre> | </pre> | ||
'''Parameters:''' | '''Parameters:''' | ||
| Line 9: | Line 10: | ||
: Required. The page title — used as both the link target and the visible title. | : Required. The page title — used as both the link target and the visible title. | ||
;icon | ;icon | ||
: Optional. An emoji or short character shown above the title. | : Optional. An emoji or short character shown above the title. Ignored if {{para|image}} is also set. | ||
;image | |||
: Optional. Filename of an uploaded image (as uploaded via [[Special:Upload]]). Shown above the title instead of the icon, cropped to fit a fixed-height box so large or oddly-shaped images don't blow out the card. | |||
;desc | ;desc | ||
: Optional. A short description shown below the title. | : Optional. A short description shown below the title. | ||
Must be used inside a {{tl|CardGridStart}} / {{tl|CardGridEnd}} pair — see [[Template:CardGridStart]]. | Must be used inside a {{tl|CardGridStart}} / {{tl|CardGridEnd}} pair — see [[Template:CardGridStart]]. | ||
</noinclude> | </noinclude> | ||
Revision as of 03:04, 14 September 2026
[[{{{1}}}|{{{1}}}]]
Usage
{{Card|Page Name}}
{{Card|Page Name|icon=🌾|desc=Short description of the page.}}
{{Card|Page Name|image=some-file.jpg|desc=Short description of the page.}}
Parameters:
- 1
- Required. The page title — used as both the link target and the visible title.
- icon
- Optional. An emoji or short character shown above the title. Ignored if Template:Para is also set.
- image
- Optional. Filename of an uploaded image (as uploaded via Special:Upload). Shown above the title instead of the icon, cropped to fit a fixed-height box so large or oddly-shaped images don't blow out the card.
- desc
- Optional. A short description shown below the title.
Must be used inside a Template:Tl / Template:Tl pair — see Template:CardGridStart.