Template:CategoryCard: Difference between revisions
Template page
More actions
No edit summary  |
Add <templatedata> for Visual Editor Usage. Â |
||
| Line 6: | Line 6: | ||
</div><noinclude> | </div><noinclude> | ||
== CategoryCard == | == CategoryCard == | ||
Displays a visual card linking to a project category hub. Used on the Main Page to show | Displays a visual card linking to a project category hub. Used on the Main Page to show project categories with an icon, name, description, and optional live count. | ||
=== Usage === | === Usage === | ||
| Line 20: | Line 20: | ||
=== Parameters === | === Parameters === | ||
; <code>icon</code> : Filename | ; <code>icon</code> : Filename without <code>.png</code> extension. Defaults to <code>places-folder</code>. | ||
; <code>name</code> : Display name | ; <code>name</code> : Display name. Defaults to "Category". | ||
; <code>link</code> : Wiki page to link to (e.g. <code>Projects/Audio</code>). | ; <code>link</code> : Wiki page to link to (e.g. <code>Projects/Audio</code>). | ||
; <code>description</code> : Optional short description shown below the name. | ; <code>description</code> : Optional short description shown below the name. | ||
; <code>count</code> : Optional | ; <code>count</code> : Optional count shown at the bottom. Use a <code>#cargo_query</code> for a live count. | ||
=== Notes === | === Notes === | ||
* Wrap multiple CategoryCards in <code>{{[[Template:CardGrid|CardGrid]]}}</code>. | * Wrap multiple CategoryCards in <code>{{[[Template:CardGrid|CardGrid]]}}</code>. | ||
<templatedata> | |||
{ | |||
  "description": "Displays a visual icon card linking to a project category hub. Wrap multiple cards in {{CardGrid}}.", | |||
  "params": { | |||
    "icon": { | |||
      "label": "Icon", | |||
      "description": "Icon filename without the .png extension (e.g. mimetypes-audio-x-generic). Defaults to places-folder.", | |||
      "type": "string", | |||
      "default": "places-folder", | |||
      "required": false | |||
    }, | |||
    "name": { | |||
      "label": "Name", | |||
      "description": "Display name shown on the card.", | |||
      "type": "string", | |||
      "default": "Category", | |||
      "required": false | |||
    }, | |||
    "link": { | |||
      "label": "Link", | |||
      "description": "Wiki page this card links to (e.g. Projects/Audio).", | |||
      "type": "wiki-page-name", | |||
      "required": true | |||
    }, | |||
    "description": { | |||
      "label": "Description", | |||
      "description": "Short description shown below the card name. Keep to one sentence.", | |||
      "type": "string", | |||
      "required": false | |||
    }, | |||
    "count": { | |||
      "label": "Count", | |||
      "description": "Number shown at the bottom of the card. Use a #cargo_query for a live count.", | |||
      "type": "content", | |||
      "required": false | |||
    } | |||
  }, | |||
  "format": "block" | |||
} | |||
</templatedata> | |||
[[Category:Layout Templates]] | [[Category:Layout Templates]] | ||
</noinclude> | </noinclude> | ||
Latest revision as of 08:25, 23 March 2026

[[|Category]]
CategoryCard
Displays a visual card linking to a project category hub. Used on the Main Page to show project categories with an icon, name, description, and optional live count.
Usage
{{CategoryCard
| icon = mimetypes-audio-x-generic
| name = Audio
| link = Projects/Audio
| description = Music, sound design, field recordings, and anything audio.
| count = {{#cargo_query:tables=Projects|fields=COUNT(DISTINCT _pageID)=n|where=categories HOLDS 'Audio'}}
}}
Parameters
icon- Filename without
.pngextension. Defaults toplaces-folder. name- Display name. Defaults to "Category".
link- Wiki page to link to (e.g.
Projects/Audio). description- Optional short description shown below the name.
count- Optional count shown at the bottom. Use a
#cargo_queryfor a live count.
Notes
- Wrap multiple CategoryCards in
{{CardGrid}}.
Displays a visual icon card linking to a project category hub. Wrap multiple cards in {{CardGrid}}.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Icon | icon | Icon filename without the .png extension (e.g. mimetypes-audio-x-generic). Defaults to places-folder.
| String | optional |
| Name | name | Display name shown on the card.
| String | optional |
| Link | link | Wiki page this card links to (e.g. Projects/Audio). | Page name | required |
| Description | description | Short description shown below the card name. Keep to one sentence. | String | optional |
| Count | count | Number shown at the bottom of the card. Use a #cargo_query for a live count. | Content | optional |