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, we’re still a work in progress. 🚧
   
       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. 
       Full Wiki launch coming soon!
   

Template:CategoryCard: Difference between revisions

Template page
No edit summary
(No difference)

Revision as of 09:06, 16 March 2026

[[|Category]]


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.

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 of the icon without the .png extension (e.g. mimetypes-audio-x-generic). Defaults to places-folder.
name
Display name shown on the card. Defaults to "Category".
link
Wiki page to link to (e.g. Projects/Audio).
description
Optional short description shown below the name.
count
Optional project count shown at the bottom. Use a #cargo_query for a live count — see usage example above.

Notes

  • For live counts, use
    Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'HOLDS 'CategoryName' ORDER BY COUNT(DISTINCT _pageID) LIMIT 100' at line 1

Function: CargoSQLQuery::run Query: SELECT COUNT(DISTINCT _pageID) AS `n` FROM `cargo__Projects` `Projects` WHERE categories HOLDS 'CategoryName' ORDER BY COUNT(DISTINCT _pageID) LIMIT 100

.

  • Wrap multiple CategoryCards in {{CardGrid}}.
Contents