Jump to content

Template:Topic Card: Difference between revisions

From WYOS Wiki
No edit summary
No edit summary
 
(14 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>
<includeonly>
<!--
<!-- Visible Infobox (for display on the wiki page only) -->
  ==================================================================
{| class="wikitable" style="float:right; margin-left:1em; width:300px;"
  == VISIBLE INFOBOX (for admin reference) - This just displays data.
|-
  ==================================================================
| colspan="2" style="text-align:center;" | {{#if:{{{Card Image|}}}|[[File:{{{Card Image}}}|290px]]|}}
-->
{| class="wikitable"
|-
|-
! Display Title
! Display Title
| {{{Display Title|}}}
| {{{Display Title|}}}
|-
|-
! Card Image
! Card Description
| {{#if:{{{Image|}}}|[[File:{{{Image}}}|150px]]|''No image''}}
| {{{Card Description|}}}
|-
|-
! Description
! Appears in Main Category
| {{{Description|}}}
| {{{Appears in Main Category|}}}
|-
|-
! Appears in Pillar
! Platform Section
| {{{Appears in category|}}}
| {{{Belongs to Platform Section|}}}
|-
|-
! Belongs to Section
! Tags (for query)
| {{{Belongs to section|}}}
| {{#arraymap:{{{Queries for Tag}}}|,|x|[[x|{{#replace:x|Tag:|}}]]|,&#32;}}
|-
{{#if:{{{Match Mode|}}}|
! Queries for Tags
{{!}}-
| {{{Queries for tags|}}}
! Match Mode
{{!}} {{{Match Mode}}}
}}
{{#if:{{{Excludes Tag|}}}|
{{!}}-
! Excludes Tag
{{!}} {{#arraymap:{{{Excludes Tag}}}|,|y|[[y|{{#replace:y|Tag:|}}]]|,&#32;}}
}}
|}
|}
<!-- Hidden Semantic Data (headless CMS source of truth) -->
<div style="display:none;">
[[Has display title::{{{Display Title|}}}]]
<!-- 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|}}}]]
{{#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}}}]]
  ==================================================================
<!-- Publication status (Draft by default) -->
  == HIDDEN SEMANTIC DATA - Single source of truth.
[[Has status::{{{Status|Draft}}}]]
  ==================================================================
-->
<div style="display:none;">
[[Category:Topic Cards]]
[[Category:Topic Cards]]
[[Has status::{{{Status|Published}}}]]
<!-- Set controlled vocabulary properties -->
{{#if:{{{Appears in category|}}}|[[Appears in category::{{{Appears in category}}}]]}}
{{#if:{{{Belongs to section|}}}|[[Belongs to section::{{{Belongs to section}}}]]}}
<!-- Set standard properties only if a value is provided -->
{{#if:{{{Display Title|}}}|[[Has display title::{{{Display Title}}}]]}}
{{#if:{{{Description|}}}|[[Has description::{{{Description}}}]]}}
{{#if:{{{Image|}}}|[[Has image::{{{Image}}}]]}}
<!--
  Set the multi-value 'Queries for tag' property.
  This uses #arraymap to handle a comma-separated list of tags from the form.
-->
{{#arraymap:{{{Queries for tags|}}}|,|x|[[Queries for tag::x]]}}
</div>
</div>
</includeonly><noinclude>
</includeonly><noinclude>
'''Template:Topic Card'''
This template creates a Topic Card (curated entry point for hub pages).
 
<templatedata>
This template defines a Topic Card, which is a clickable tile that appears on the main Knowledge and Resources hub pages.
{
 
"params": {
=== How It Works ===
"Display Title": {
A Topic Card is a dynamic content aggregator. It uses the '''Queries for tag''' property to pull in all Knowledge or Resource entries that match one or more specified Topic Tags.
"label": "Display Title",
 
"description": "Main title shown on the card.",
=== Parameters ===
"type": "line",
*  '''Display Title''': The title displayed on the card.
"required": true
*  '''Image''': The image file for the card. Uses the generic '''Has image''' property.
},
*  '''Description''': The short text appearing on the card. Uses the generic '''Has description''' property.
"Card Image": {
*  '''Appears in category''': The Main Category (e.g., [[Category:Be Productive]]) where this card should be displayed.
"label": "Card Image",
*  '''Belongs to section''': The section hub this card appears on (e.g., "Knowledge" or "Resources").
"description": "Image file for the card (e.g., \"Topic_habits.webp\").",
*  '''Queries for tags''': A comma-separated list of links to the topic pages this card should pull content from (e.g., [[Tag:Habits]], [[Tag:Psychology]]). This is the most critical field.
"type": "wiki-file-name"
*  '''Status''': Publication status (Published, Draft). Defaults to Published.
},
 
"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.

Template parameters[Edit template data]

This template prefers block formatting of parameters.

ParameterDescriptionTypeStatus
Display TitleDisplay Title

Main title shown on the card.

Linerequired
Card ImageCard Image

Image file for the card (e.g., "Topic_habits.webp").

Fileoptional
Card DescriptionCard Description

Short teaser text for the card.

Stringrequired
Appears in Main CategoryAppears in Main Category

Main Category page where this card appears (e.g., "Master Yourself").

Page namerequired
Platform SectionBelongs to Platform Section

Exactly "Knowledge" or "Resources".

Suggested values
Knowledge Resources
Linerequired
Tags (for query)Queries for Tag

Comma-separated Tag pages. Accepts either "Tag:Habits, Tag:Routines" or "Habits, Routines".

Linerequired
Excludes TagExcludes Tag

Optional comma-separated Tag pages to exclude.

Lineoptional
Match ModeMatch Mode

"ANY" (OR) or "ALL" (AND). Defaults to ANY.

Suggested values
ANY ALL
Lineoptional
StatusStatus

"Draft", "Published", or "Archived". Defaults to "Draft".

Suggested values
Draft Published Archived
Default
Draft
Lineoptional