Template:TutorialCard: Difference between revisions
More actions
Add <templatedata> for Visual Editor Usage. |
No edit summary Β |
||
| Line 1: | Line 1: | ||
<templatestyles src="TutorialCard/styles.css"/><div class="tutorial-card-wrap" data-title="{{lc:{{{name|}}}}}" data-topic="{{lc:{{{topics|}}}}}" data-difficulty="{{lc:{{{difficulty|}}}}}" data-tags="{{lc:{{{tags|}}}}}" data-page="{{urlencode:{{{pagename|}}}|WIKI}}"><div class="tutorial-card"><div class="tutorial-card-image">{{#if:{{{image|}}}|[[File:{{{image}}}|200px|link=]]|<div class="tutorial-card-image-fallback">[[File:mimetypes-text-x-generic.png|48px|link=]]</div>}}</div><div class="tutorial-card-body"><div class="tutorial-card-title">[[{{{pagename|}}}|{{{name|Tutorial}}}]]</div | <templatestyles src="TutorialCard/styles.css"/><div class="tutorial-card-wrap" data-title="{{lc:{{{name|}}}}}" data-topic="{{lc:{{{topics|}}}}}" data-difficulty="{{lc:{{{difficulty|}}}}}" data-tags="{{lc:{{{tags|}}}}}" data-page="{{urlencode:{{{pagename|}}}|WIKI}}"><div class="tutorial-card"><div class="tutorial-card-image">{{#if:{{{image|}}}|[[File:{{{image}}}|200px|link=]]|<div class="tutorial-card-image-fallback">[[File:mimetypes-text-x-generic.png|48px|link=]]</div>}}</div><div class="tutorial-card-body"><div class="tutorial-card-title">[[{{{pagename|}}}|{{{name|Tutorial}}}]]</div>{{#if:{{{tags|}}}|<div class="tutorial-card-meta">{{#arraymap:{{{tags|}}}|,|@@|<span class="tutorial-card-tag">@@</span>| }}</div>|}}<div class="tutorial-card-stats"><span class="tutorial-card-contributors"></span><span class="tutorial-card-updated"></span></div></div><div class="tutorial-card-description">{{{description|}}}</div></div></div><noinclude> | ||
== TutorialCard == | == TutorialCard == | ||
Displays a visual tutorial card used inside collapsible topic sections on the [[Tutorials]] hub. Shows a cover image, tutorial name, topic tag, difficulty badge, contributor stats, and a hover description overlay. | Displays a visual tutorial card used inside collapsible topic sections on the [[Tutorials]] hub. Shows a cover image, tutorial name, topic tag, difficulty badge, contributor stats, and a hover description overlay. | ||
Latest revision as of 00:24, 3 April 2026
TutorialCard
Displays a visual tutorial card used inside collapsible topic sections on the Tutorials hub. Shows a cover image, tutorial name, topic tag, difficulty badge, contributor stats, and a hover description overlay.
Styles are loaded from Template:TutorialCard/styles.css.
β οΈ This template is called automatically by Cargo via #cargo_query inside Template:TutorialSection. You should not need to call it manually. See Template:TutorialMeta for how tutorials are submitted to the database.
Called by Cargo β example query
{{#cargo_query:
tables = Tutorials
| fields = _pageName=pagename, name, topics, difficulty, description, image, tags
| where = topics HOLDS 'Audio'
| order by = Tutorials._pageName
| limit = 500
| format = template
| template = TutorialCard
| named args = yes
| no results text =
}}
Parameters (passed by Cargo via named args=yes)
pagename- Full page name (aliased from
_pageName). Used for the card title link. name- Tutorial display name.
topics- Topic string (e.g.
Audio). Shown as an orange tag badge. difficulty- Difficulty level. Values:
Beginner(green),Intermediate(yellow),Advanced(red). description- Short description shown in the hover overlay.
image- Cover image filename (e.g.
MyThumbnail.png). tags- Space-separated tags used for in-section filtering.
Displays a visual tutorial card. Normally called automatically by Cargo inside TutorialSection β see Template:TutorialMeta for submitting tutorials.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Page name | pagename | Full wiki page name of the tutorial. Used for the card title link. | Page name | required |
| Tutorial name | name | Display name shown on the card. | String | optional |
| Topics | topics | Comma-separated topic string (e.g. Audio). Shown as tag badges on the card. | String | optional |
| Difficulty | difficulty | Difficulty level shown as a coloured badge.
| String | optional |
| Description | description | Short description shown in the hover overlay. Keep to 1-2 sentences. | Content | optional |
| Cover image | image | Cover image filename without File: prefix (e.g. MyThumbnail.png). | File | optional |
| Tags | tags | Space-separated keywords used for filtering within tutorial sections. | String | optional |