Jump to content

Template:Topic Card: Difference between revisions

From WYOS Wiki
No edit summary
No edit summary
Line 1: Line 1:
<includeonly>
<includeonly>
{| class="wikitable" style="float:right; margin-left:1em; width:300px;"
<!--
| colspan="2" style="text-align:center;" | [[File:{{{Card Image|}}}|290px]]
  ==================================================================
  == VISIBLE INFOBOX (for admin reference) - This just displays data.
  ==================================================================
-->
{| class="wikitable"
|-
|-
! Display Title
! Display Title
| {{{Display Title|}}}
| {{{Display Title|}}}
|-
! Card Image
| {{#if:{{{Image|}}}|[[File:{{{Image}}}|150px]]|''No image''}}
|-
|-
! Description
! Description
| [[Has card description::{{{Card Description|}}}]]
| {{{Description|}}}
|-
! Appears in Pillar
| {{{Appears in category|}}}
|-
|-
! Appears In Category
! Belongs to Section
| [[Appears in category::{{{Appears In Category|}}}]]
| {{{Belongs to section|}}}
|-
|-
! Queries For Tags
! Queries for Tags
| {{{Queries For Tags|}}}
| {{{Queries for tags|}}}
|}
|}
<!--
  ==================================================================
  == HIDDEN SEMANTIC DATA - Single source of truth.
  ==================================================================
-->
<div style="display:none;">
<div style="display:none;">
<!-- Invisible Data Section -->
[[Category:Topic Cards]]
[[Has display title::{{{Display Title|}}}]]
[[Has status::{{{Status|Published}}}]]
[[Belongs to section::{{{section|}}}]]
 
[[Has card image::{{{Card Image|}}}]]
<!-- Set controlled vocabulary properties -->
[[Has status::{{{status|Draft}}}]]
{{#if:{{{Appears in category|}}}|[[Appears in category::{{{Appears in category}}}]]}}
{{#arraymap:{{{Queries For Tags|}}}|,|x|[[Queries for tag::x]]}}
{{#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>
[[Category:Topic Cards]]
</includeonly><noinclude>
</includeonly><noinclude>
This template is for Topic Cards that define curated resource collections.
'''Template:Topic Card'''
 
This template defines a Topic Card, which is a clickable tile that appears on the main Knowledge and Resources hub pages.
 
=== How It Works ===
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.
 
=== Parameters ===
*  '''Display Title''': The title displayed on the card.
*  '''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.
*  '''Appears in category''': The Main Category (e.g., [[Category:Be Productive]]) where this card should be displayed.
*  '''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.
 
</noinclude>
</noinclude>

Revision as of 06:09, 20 September 2025

Template:Topic Card

This template defines a Topic Card, which is a clickable tile that appears on the main Knowledge and Resources hub pages.

How It Works

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.

Parameters

  • Display Title: The title displayed on the card.
  • 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.
  • Appears in category: The Main Category (e.g., ) where this card should be displayed.
  • 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.