Template:Topic Card: Difference between revisions
Appearance
No edit summary |
No edit summary |
||
| (13 intermediate revisions by the same user not shown) | |||
| Line 18: | Line 18: | ||
|- | |- | ||
! Tags (for query) | ! Tags (for query) | ||
| {{{Queries for Tag|}}} | | {{#arraymap:{{{Queries for Tag}}}|,|x|[[x|{{#replace:x|Tag:|}}]]|, }} | ||
{{#if:{{{Match Mode|}}}| | {{#if:{{{Match Mode|}}}| | ||
{{!}}- | |||
! Match Mode | ! Match Mode | ||
{{!}} {{{Match Mode}}} | |||
}} | }} | ||
{{#if:{{{Excludes Tag|}}}| | {{#if:{{{Excludes Tag|}}}| | ||
{{!}}- | |||
! Excludes Tag | ! Excludes Tag | ||
{{!}} {{#arraymap:{{{Excludes Tag}}}|,|y|[[y|{{#replace:y|Tag:|}}]]|, }} | |||
}} | }} | ||
|} | |} | ||
<!-- Hidden Semantic Data (headless CMS source of truth) --> | |||
<!-- Hidden Semantic Data ( | |||
<div style="display:none;"> | <div style="display:none;"> | ||
[[Has display title::{{{Display Title|}}}]] | [[Has display title::{{{Display Title|}}}]] | ||
[[Has card image::{{{Card Image|}}}]] | <!-- Robust image handling: add File: if missing --> | ||
{{#if:{{{Card Image|}}} | |||
| [[Has card image::{{#ifeq:{{lc:{{#titleparts:{{{Card Image}}}|1|1}}}}|file|{{{Card Image}}}|File:{{{Card Image}}}}}]] | |||
}} | |||
[[Has card description::{{{Card Description|}}}]] | [[Has card description::{{{Card Description|}}}]] | ||
{{#if:{{{Appears in Main Category|}}} | |||
| [[Appears in main category::{{{Appears in Main Category}}}]] | |||
}} | |||
{{#if:{{{Belongs to Platform Section|}}} | |||
| [[Belongs to platform section::{{{Belongs to Platform Section}}}]] | |||
}} | |||
<!-- Set multi-value properties by splitting the comma-separated input from the form --> | |||
{{#if:{{{Queries for Tag|}}} | |||
| {{#arraymap:{{{Queries for Tag}}}|,|x|[[Queries for tag::x]]|\s}} | |||
}} | |||
{{#if:{{{Excludes Tag|}}} | |||
| {{#arraymap:{{{Excludes Tag}}}|,|y|[[Excludes tag::y]]|\s}} | |||
}} | |||
[[Match mode::{{{Match Mode|ANY}}}]] | [[Match mode::{{{Match Mode|ANY}}}]] | ||
<!-- Publication status (Draft by default) --> | |||
<!-- | |||
[[Has status::{{{Status|Draft}}}]] | [[Has status::{{{Status|Draft}}}]] | ||
[[Category:Topic Cards]] | [[Category:Topic Cards]] | ||
</div> | </div> | ||
</includeonly><noinclude> | </includeonly><noinclude> | ||
This template | This template creates a Topic Card (curated entry point for hub pages). | ||
<templatedata> | |||
{ | |||
"params": { | |||
"Display Title": { | |||
"label": "Display Title", | |||
"description": "Main title shown on the card.", | |||
"type": "line", | |||
"required": true | |||
}, | |||
"Card Image": { | |||
"label": "Card Image", | |||
"description": "Image file for the card (e.g., \"Topic_habits.webp\").", | |||
"type": "wiki-file-name" | |||
}, | |||
"Card Description": { | |||
"label": "Card Description", | |||
"description": "Short teaser text for the card.", | |||
"type": "string", | |||
"required": true | |||
}, | |||
"Appears in Main Category": { | |||
"label": "Appears in Main Category", | |||
"description": "Main Category page where this card appears (e.g., \"Master Yourself\").", | |||
"type": "wiki-page-name", | |||
"required": true | |||
}, | |||
"Belongs to Platform Section": { | |||
"label": "Platform Section", | |||
"description": "Exactly \"Knowledge\" or \"Resources\".", | |||
"type": "line", | |||
"suggestedvalues": [ | |||
"Knowledge", | |||
"Resources" | |||
], | |||
"required": true | |||
}, | |||
"Queries for Tag": { | |||
"label": "Tags (for query)", | |||
"description": "Comma-separated Tag pages. Accepts either \"Tag:Habits, Tag:Routines\" or \"Habits, Routines\".", | |||
"type": "line", | |||
"required": true | |||
}, | |||
"Excludes Tag": { | |||
"label": "Excludes Tag", | |||
"description": "Optional comma-separated Tag pages to exclude.", | |||
"type": "line" | |||
}, | |||
"Match Mode": { | |||
"label": "Match Mode", | |||
"description": "\"ANY\" (OR) or \"ALL\" (AND). Defaults to ANY.", | |||
"type": "line", | |||
"suggestedvalues": [ | |||
"ANY", | |||
"ALL" | |||
] | |||
}, | |||
"Status": { | |||
"label": "Status", | |||
"description": "\"Draft\", \"Published\", or \"Archived\". Defaults to \"Draft\".", | |||
"type": "line", | |||
"suggestedvalues": [ | |||
"Draft", | |||
"Published", | |||
"Archived" | |||
], | |||
"default": "Draft" | |||
} | |||
}, | |||
"description": "Template for Topic Cards used on hub pages.", | |||
"format": "block" | |||
} | |||
</templatedata> | |||
</noinclude> | </noinclude> | ||
Latest revision as of 19:58, 23 September 2025
This template creates a Topic Card (curated entry point for hub pages).
Template for Topic Cards used on hub pages.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Display Title | Display Title | Main title shown on the card. | Line | required |
| Card Image | Card Image | Image file for the card (e.g., "Topic_habits.webp"). | File | optional |
| Card Description | Card Description | Short teaser text for the card. | String | required |
| Appears in Main Category | Appears in Main Category | Main Category page where this card appears (e.g., "Master Yourself"). | Page name | required |
| Platform Section | Belongs to Platform Section | Exactly "Knowledge" or "Resources".
| Line | required |
| Tags (for query) | Queries for Tag | Comma-separated Tag pages. Accepts either "Tag:Habits, Tag:Routines" or "Habits, Routines". | Line | required |
| Excludes Tag | Excludes Tag | Optional comma-separated Tag pages to exclude. | Line | optional |
| Match Mode | Match Mode | "ANY" (OR) or "ALL" (AND). Defaults to ANY.
| Line | optional |
| Status | Status | "Draft", "Published", or "Archived". Defaults to "Draft".
| Line | optional |