Jump to content

Template:Topic Card: Difference between revisions

From WYOS Wiki
No edit summary
No edit summary
Line 18: Line 18:
|-
|-
! Tags (for query)
! Tags (for query)
| {{#arraymap:{{{Queries for Tag|}}}|,|ITEM|
| {{#show: {{FULLPAGENAME}} |?Queries for tag}}
    {{#ifeq:{{lc:{{#titleparts:{{#trim:ITEM}}|1|1}}}}|tag
      | [[{{#trim:ITEM}} {{!}} {{#replace:{{#trim:ITEM}}|Tag:|}}]]
      | [[Tag:{{#trim:ITEM}} {{!}} {{#trim:ITEM}}]]
    }}
  |, }}
{{#if:{{{Match Mode|}}}|
{{#if:{{{Match Mode|}}}|
|-
|-
Line 32: Line 27:
|-
|-
! Excludes Tag
! Excludes Tag
| {{#arraymap:{{{Excludes Tag|}}}|,|ITEM|
| {{#show: {{FULLPAGENAME}} |?Excludes tag}}
    {{#ifeq:{{lc:{{#titleparts:{{#trim:ITEM}}|1|1}}}}|tag
      | [[{{#trim:ITEM}} {{!}} {{#replace:{{#trim:ITEM}}|Tag:|}}]]
      | [[Tag:{{#trim:ITEM}} {{!}} {{#trim:ITEM}}]]
    }}
  |, }}
}}
}}
|}
|}
<!-- Hidden Semantic Data (headless CMS source of truth) -->
<!-- Hidden Semantic Data (headless CMS source of truth) -->
<div style="display:none;">
<div style="display:none;">
[[Has display title::{{{Display Title|}}}]]
[[Has display title::{{{Display Title|}}}]]
<!-- Robust image handling: add File: if missing -->
<!-- Robust image handling: add File: if missing -->
{{#if:{{{Card Image|}}}
{{#if:{{{Card Image|}}}
  | [[Has card image::{{#ifeq:{{lc:{{#titleparts:{{{Card Image}}}|1|1}}}}|file|{{{Card Image}}}|File:{{{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|}}}
{{#if:{{{Appears in Main Category|}}}
  | [[Appears in main category::{{{Appears in Main Category}}}]]
  | [[Appears in main category::{{{Appears in Main Category}}}]]
Line 59: Line 44:
  | [[Belongs to platform section::{{{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 -->
<!-- Normalize tag inputs to Tag: namespace -->
{{#if:{{{Queries for Tag|}}}
{{#if:{{{Queries for Tag|}}}
  | {{#arraymap:{{{Queries for Tag|}}}|,|x|
  | [[Queries for tag::{{{Queries for Tag}}}|+sep=,]]
    [[Queries for tag::{{#ifeq:{{lc:{{#titleparts:{{#trim:x}}|1|1}}}}|tag
      | {{#trim:x}}
      | Tag:{{#trim:x}}
    }}]]
  }}
}}
}}
{{#if:{{{Excludes Tag|}}}
{{#if:{{{Excludes Tag|}}}
  | {{#arraymap:{{{Excludes Tag|}}}|,|y|
  | [[Excludes tag::{{{Excludes Tag}}}|+sep=,]]
    [[Excludes tag::{{#ifeq:{{lc:{{#titleparts:{{#trim:y}}|1|1}}}}|tag
      | {{#trim:y}}
      | Tag:{{#trim:y}}
    }}]]
  }}
}}
}}
[[Match mode::{{{Match Mode|ANY}}}]]
[[Match mode::{{{Match Mode|ANY}}}]]
<!-- Publication status (Draft by default) -->
<!-- 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 creates a Topic Card (curated entry point for hub pages).
This template creates a Topic Card (curated entry point for hub pages).
<templatedata>
<templatedata>
{
{

Revision as of 04:38, 22 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