Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
   
       🚧 True to our name, this project is still not quite finished. 🚧
   
   You’re welcome to explore, but account registration is currently invite-only as we finalize the setup. 
   Join our forum or follow Mastodon for updates. 
   Wiki registration will be available soon!

Template:CategoryCard: Difference between revisions

Template page
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 all project categories with an icon, name, description, and live project count.
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 of the icon without the <code>.png</code> extension (e.g. <code>mimetypes-audio-x-generic</code>). Defaults to <code>places-folder</code>.
; <code>icon</code> : Filename without <code>.png</code> extension. Defaults to <code>places-folder</code>.
; <code>name</code> : Display name shown on the card. Defaults to "Category".
; <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 project count shown at the bottom. Use a <code>#cargo_query</code> for a live count — see usage example above.
; <code>count</code> : Optional count shown at the bottom. Use a <code>#cargo_query</code> for a live count.


=== Notes ===
=== Notes ===
* For live counts, use <code>{{#cargo_query:tables=Projects|fields=COUNT(DISTINCT _pageID)=n|where=categories HOLDS 'CategoryName'}}</code>.
* 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 .png extension. Defaults to places-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_query for 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}}.

Template parameters[Edit template data]

This template prefers block formatting of parameters.

ParameterDescriptionTypeStatus
Iconicon

Icon filename without the .png extension (e.g. mimetypes-audio-x-generic). Defaults to places-folder.

Default
places-folder
Stringoptional
Namename

Display name shown on the card.

Default
Category
Stringoptional
Linklink

Wiki page this card links to (e.g. Projects/Audio).

Page namerequired
Descriptiondescription

Short description shown below the card name. Keep to one sentence.

Stringoptional
Countcount

Number shown at the bottom of the card. Use a #cargo_query for a live count.

Contentoptional
Contents