Template:Topic Card: Difference between revisions
Appearance
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
<includeonly> | <includeonly> | ||
<!-- | |||
================================================================== | |||
== 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 | ||
| | | {{{Description|}}} | ||
|- | |||
! Appears in Pillar | |||
| {{{Appears in category|}}} | |||
|- | |- | ||
! | ! Belongs to Section | ||
| | | {{{Belongs to section|}}} | ||
|- | |- | ||
! Queries | ! Queries for Tags | ||
| {{{Queries | | {{{Queries for tags|}}} | ||
|} | |} | ||
<!-- | |||
================================================================== | |||
== HIDDEN SEMANTIC DATA - Single source of truth. | |||
================================================================== | |||
--> | |||
<div style="display:none;"> | <div style="display:none;"> | ||
<!-- | [[Category:Topic Cards]] | ||
[[ | [[Has status::{{{Status|Published}}}]] | ||
[[Belongs to section::{{{section|}}}]] | |||
[[Has | <!-- Set controlled vocabulary properties --> | ||
[[Has | {{#if:{{{Appears in category|}}}|[[Appears in category::{{{Appears in category}}}]]}} | ||
{{#arraymap:{{{Queries | {{#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> | ||
This template is for Topic | '''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.