Jump to content

Template:Topic Card: Difference between revisions

From WYOS Wiki
No edit summary
No edit summary
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|}}}
|-
! Appears in Main Category
| {{{Appears in Main Category|}}}
|-
|-
! Description
! Platform Section
| {{{Description|}}}
| {{{Belongs to Platform Section|}}}
|-
|-
! Appears in Pillar
! Tags (for query)
| {{{Appears in category|}}}
| {{{Queries for Tag|}}}
{{#if:{{{Match Mode|}}}|
|-
|-
! Belongs to Section
! Match Mode
| {{{Belongs to section|}}}
| {{{Match Mode}}}
}}
{{#if:{{{Excludes Tag|}}}|
|-
|-
! Queries for Tags
! Excludes Tag
| {{{Queries for tags|}}}
| {{{Excludes Tag}}}
}}
|}
|}


<!--
<!-- Hidden Semantic Data (this is the critical part for your headless CMS) -->
  ==================================================================
  == HIDDEN SEMANTIC DATA - Single source of truth.
  ==================================================================
-->
<div style="display:none;">
<div style="display:none;">
[[Category:Topic Cards]]
[[Has display title::{{{Display Title|}}}]]
[[Has status::{{{Status|Published}}}]]
[[Has card image::{{{Card Image|}}}]]
[[Has card description::{{{Card Description|}}}]]


<!-- Set controlled vocabulary properties -->
[[Appears in main category::{{{Appears in Main Category|}}}]]
{{#if:{{{Appears in category|}}}|[[Appears in category::{{{Appears in category}}}]]}}
[[Belongs to platform section::{{{Belongs to Platform Section|}}}]]
{{#if:{{{Belongs to section|}}}|[[Belongs to section::{{{Belongs to section}}}]]}}


<!-- Set standard properties only if a value is provided -->
<!-- Multi-value property for tags to query. #trim removes accidental spaces. -->
{{#if:{{{Display Title|}}}|[[Has display title::{{{Display Title}}}]]}}
{{#arraymap:{{{Queries for Tag|}}}|,|x|[[Queries for tag::{{#trim:x}}]]}}
{{#if:{{{Description|}}}|[[Has description::{{{Description}}}]]}}
{{#if:{{{Image|}}}|[[Has image::{{{Image}}}]]}}


<!--
<!-- Optional: multi-value property for tags to exclude. -->
  Set the multi-value 'Queries for tag' property.
{{#if:{{{Excludes Tag|}}}|{{#arraymap:{{{Excludes Tag|}}}|,|y|[[Excludes tag::{{#trim:y}}]]}}}}
  This uses #arraymap to handle a comma-separated list of tags from the form.
-->
{{#arraymap:{{{Queries for tags|}}}|,|x|[[Queries for tag::x]]}}
</div>
</includeonly><noinclude>
'''Template:Topic Card'''


This template defines a Topic Card, which is a clickable tile that appears on the main Knowledge and Resources hub pages.
<!-- Optional: sets the query logic. Defaults to 'ANY' (OR logic). -->
[[Match mode::{{{Match Mode|ANY}}}]]


=== How It Works ===
<!-- Sets the publication status. Defaults to 'Draft'. -->
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.
[[Has status::{{{Status|Draft}}}]]


=== Parameters ===
<!-- Assigns this page to the correct category for management. -->
*  '''Display Title''': The title displayed on the card.
[[Category:Topic Cards]]
*  '''Image''': The image file for the card. Uses the generic '''Has image''' property.
</div>
*  '''Description''': The short text appearing on the card. Uses the generic '''Has description''' property.
</includeonly><noinclude>
*  '''Appears in category''': The Main Category (e.g., [[Category:Be Productive]]) where this card should be displayed.
This template is for creating Topic Cards, which act as curated entry points on the main hub pages.
*  '''Belongs to section''': The section hub this card appears on (e.g., "Knowledge" or "Resources").
*  '''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.
*  '''Status''': Publication status (Published, Draft). Defaults to Published.


== Parameters ==
; Display Title : (Text) The main title shown on the card.
; Card Image : (File) The image file used on the card (e.g., "Topic_habits.webp").
; Card Description : (Text) The short teaser text for the card.
; Appears in Main Category : (Page) The Main Category page where this card should appear (e.g., "Master Yourself").
; Belongs to Platform Section : (Text) Exactly "Knowledge" or "Resources".
; Queries for Tag : (Comma-separated Page Titles) The Tag pages to pull content from (e.g., "Tag:Habits,Tag:Routines").
; Excludes Tag : (Optional, Comma-separated Page Titles) Tag pages to exclude from the results.
; Match Mode : (Optional, Text) "ANY" or "ALL". Defaults to "ANY".
; Status : (Text) "Draft", "Published", or "Archived". Defaults to "Draft".
</noinclude>
</noinclude>

Revision as of 05:00, 21 September 2025

This template is for creating Topic Cards, which act as curated entry points on the main hub pages.

Parameters

Display Title
(Text) The main title shown on the card.
Card Image
(File) The image file used on the card (e.g., "Topic_habits.webp").
Card Description
(Text) The short teaser text for the card.
Appears in Main Category
(Page) The Main Category page where this card should appear (e.g., "Master Yourself").
Belongs to Platform Section
(Text) Exactly "Knowledge" or "Resources".
Queries for Tag
(Comma-separated Page Titles) The Tag pages to pull content from (e.g., "Tag:Habits,Tag:Routines").
Excludes Tag
(Optional, Comma-separated Page Titles) Tag pages to exclude from the results.
Match Mode
(Optional, Text) "ANY" or "ALL". Defaults to "ANY".
Status
(Text) "Draft", "Published", or "Archived". Defaults to "Draft".