Template:Card: Difference between revisions
No edit summary |
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:{{{image|}}}| | <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|}}}|[[File:{{{image}}}|220px|center]]|{{#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> | ||
| Line 12: | Line 12: | ||
: Optional. An emoji or short character shown above the title. Ignored if {{para|image}} is also set. | : Optional. An emoji or short character shown above the title. Ignored if {{para|image}} is also set. | ||
;image | ;image | ||
: Optional. Filename of an uploaded image | : Optional. Filename of an uploaded image. Shown above the title instead of the icon, scaled to 220px wide. Note: height will vary by image — not cropped to a fixed box. | ||
;desc | ;desc | ||
: Optional. A short description shown below the title. | : Optional. A short description shown below the title. | ||
Revision as of 03:09, 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. Shown above the title instead of the icon, scaled to 220px wide. Note: height will vary by image — not cropped to a fixed box.
- desc
- Optional. A short description shown below the title.
Must be used inside a Template:Tl / Template:Tl pair — see Template:CardGridStart.