Jump to content

Template:Knowledge: Difference between revisions

From WYOS Wiki
No edit summary
No edit summary
Line 1: Line 1:
<includeonly>
<includeonly>
<!--  
<!--
   ==================================================================
   ==================================================================
   == VISIBLE INFOBOX - This section only displays data.
   == VISIBLE INFOBOX - Conditional display for wiki/admin views.
  == It does not assign any semantic properties.
   ==================================================================
   ==================================================================
-->
-->
{| class="wikitable wyos-infobox" style="float:right; margin-left:1em; width:300px;"
{| class="wikitable wyos-infobox" style="float:right; margin-left:1em; width:300px;"
| colspan="2" style="text-align:center;" | {{#if:{{{Image|}}}|[[File:{{{Image}}}|290px]]|''No image provided''}}
| colspan="2" style="text-align:center;" | {{#if:{{{Image|}}}|[[File:{{{Image}}}|290px]]|''No image provided''}}
{{#if:{{{Display Title|}}}|{{!}}-
{{#if:{{{Display Title|}}}|
{{!}}-
! Display Title
! Display Title
{{!}} {{{Display Title}}}
{{!}} {{{Display Title}}}
}}
}}
{{#if:{{{Subtitle|}}}|{{!}}-
{{#if:{{{Subtitle|}}}|
{{!}}-
! Subtitle
! Subtitle
{{!}} {{{Subtitle}}}
{{!}} {{{Subtitle}}}
}}
}}
{{#if:{{{Knowledge Format|}}}|{{!}}-
{{#if:{{{Knowledge Format|}}}|
{{!}}-
! Format
! Format
{{!}} {{{Knowledge Format}}}
{{!}} {{{Knowledge Format}}}
}}
}}
{{#if:{{{Author|}}}|{{!}}-
{{#if:{{{Author|}}}|
{{!}}-
! Author
! Author
{{!}} {{{Author}}}
{{!}} {{{Author}}}
}}
}}
{{#if:{{{Original Title|}}}|{{!}}-
{{#if:{{{Original Title|}}}|
{{!}}-
! Original Title
! Original Title
{{!}} "{{{Original Title}}}"
{{!}} "{{{Original Title}}}"
}}
}}
{{#if:{{{Original Source|}}}|{{!}}-
{{#if:{{{Original Source|}}}|
{{!}}-
! Source Type
! Source Type
{{!}} {{{Original Source}}}
{{!}} {{{Original Source}}}
}}
}}
{{#if:{{{URL|}}}|{{!}}-
{{#if:{{{URL|}}}|
{{!}}-
! URL
! URL
{{!}} [{{{URL}}} External Link]
{{!}} [{{{URL}}} External Link]
}}
}}
{{#if:{{{Topic Tags|}}}|{{!}}-
{{#if:{{{Topic Tags|}}}|
{{!}}-
! Topics
! Topics
{{!}} {{{Topic Tags}}}
{{!}} {{{Topic Tags}}}
}}
}}
{{#if:{{{Status|}}}|{{!}}-
{{#if:{{{Status|}}}|
{{!}}-
! Status
! Status
{{!}} {{{Status}}}
{{!}} {{{Status}}}
}}
}}
{{#if:{{{Is Featured|}}}|{{!}}-
{{#if:{{{Is Featured|}}}|
{{!}}-
! Featured
! Featured
{{!}} {{{Is Featured}}}
{{!}} {{#ifeq:{{lc:{{{Is Featured|no}}}}}|yes|Yes|No}}
}}
}}
{{#if:{{{Description|}}}|{{!}}-
{{#if:{{{Owner|}}}|
{{!}}-
! Owner
{{!}} [[User:{{{Owner}}}|{{{Owner}}}]]
}}
{{#if:{{{Description|}}}|
{{!}}-
! Description
! Description
{{!}} {{{Description}}}
{{!}} {{{Description}}}
Line 54: Line 69:
|}
|}


<!--  
<!--
   ==================================================================
   ==================================================================
   == HIDDEN SEMANTIC DATA - This is the single source of truth for  
   == HIDDEN SEMANTIC DATA - Single source for API queries.
  == assigning all semantic properties for the entry.
   ==================================================================
   ==================================================================
-->
-->
<div style="display:none;">
<div style="display:none;">
[[Category:Knowledge]]
[[Category:Knowledge]]
[[Belongs to section::Knowledge]]


<!-- Set controlled vocabulary properties -->
<!-- RECOMMENDED: Do NOT set Belongs to platform section here (Topic Cards decide hub placement). -->
[[Has status::{{{Status|Published}}}]]
<!-- ALTERNATIVE (if needed): [[Belongs to platform section::Knowledge]] -->
 
<!-- Controlled vocab / state (Text types; enforce via forms) -->
[[Has status::{{{Status|Draft}}}]]
{{#if:{{{Knowledge Format|}}}|[[Has knowledge format::{{{Knowledge Format}}}]]}}
{{#if:{{{Knowledge Format|}}}|[[Has knowledge format::{{{Knowledge Format}}}]]}}
{{#if:{{{Original Source|}}}|[[Has original source::{{{Original Source}}}]]}}
{{#if:{{{Original Source|}}}|[[Has original source::{{{Original Source}}}]]}}


<!-- Set standard properties only if a value is provided -->
<!-- Standard props (Text/Page/URL) -->
{{#if:{{{Display Title|}}}|[[Has display title::{{{Display Title}}}]]}}
{{#if:{{{Display Title|}}}|[[Has display title::{{{Display Title}}}]]}}
{{#if:{{{Subtitle|}}}|[[Has subtitle::{{{Subtitle}}}]]}}
{{#if:{{{Subtitle|}}}|[[Has subtitle::{{{Subtitle}}}]]}
{{#if:{{{Image|}}}|[[Has image::{{{Image}}}]]}}
{{#if:{{{Description|}}}|[[Has description::{{{Description}}}]]}}
{{#if:{{{Description|}}}|[[Has description::{{{Description}}}]]}}
{{#if:{{{URL|}}}|[[Has url::{{{URL}}}]]}}
{{#if:{{{URL|}}}|[[Has url::{{{URL}}}]]}}
{{#if:{{{Author|}}}|[[Has author::{{{Author}}}]]}}
{{#if:{{{Author|}}}|[[Has author::{{{Author}}}]]}}
{{#if:{{{Original Title|}}}|[[Has original title::{{{Original Title}}}]]}}
{{#if:{{{Original Title|}}}|[[Has original title::{{{Original Title}}}]]}}
{{#if:{{{Owner|}}}|[[Has owner::{{{Owner}}}]]}}
<!-- Robust image (File type) -->
{{#if:{{{Image|}}}|[[Has image::{{#ifeq:{{lc:{{#titleparts:{{{Image}}}|1|1}}}}|file|{{{Image}}}|File:{{{Image}}}}}}]}


<!-- Set boolean property -->
<!-- Boolean (true/false for queries) -->
[[Is featured::{{#ifeq:{{lc:{{{Is Featured|no}}}}}|yes|yes|no}}]]
[[Is featured::{{#ifeq:{{lc:{{{Is Featured|no}}}}}|yes|true|false}}]]


<!-- Set multi-value 'Page' properties -->
<!-- Multi-value tags (Page type; trims spaces, comma-separated Tag: pages) -->
{{#arraymap:{{{Topic Tags|}}}|,|x|[[Has topic tag::x]]}}
{{#if:{{{Topic Tags|}}}|{{#arraymap:{{{Topic Tags|}}}|,|x|[[Has topic tag::{{#trim:x}}]]}}}
</div>
</div>


<!--  
<!--
   ==================================================================
   ==================================================================
   == CONTENT SECTIONS - Populated by format-specific templates.
   == CONTENT - Populated by format-specific wrappers (e.g., Template:Summary).
  == This is where the rich text content from VEForAll will appear.
   ==================================================================
   ==================================================================
-->
-->
{{{Content|}}}
{{{Content|}}}
</includeonly><noinclude>
</includeonly><noinclude>
'''Template:Knowledge'''
'''Template:Knowledge'''


This is the MASTER template for all Knowledge section entries. It should NOT be called directly.
Master template for Knowledge entries—call via format wrappers only (e.g., {{Summary}}). Handles infobox and shared semantics for headless API pulls.
This template handles the infobox display and assigns all shared semantic properties.


Use a format-specific wrapper template (e.g., Template:Summary), which will call this one and provide the necessary data.
=== Parameters ===
* '''Display Title''': Required; user-facing title (Text).
* '''Subtitle''': Optional; tagline (Text).
* '''Description''': Optional; card teaser (Text).
* '''Image''': Optional; filename, auto-prefixes File: (File).
* '''Knowledge Format''': Auto-passed by wrapper (Page; controlled: Guides|Summaries|etc.).
* '''Topic Tags''': Required; comma-separated Tag: pages (e.g., Tag:Habits,Tag:Productivity) for multi-value filtering (Page).
* '''Status''': Publication state; defaults Draft (Text; controlled: Draft|Published|Archived).
* '''Is Featured''': yes/no flag; defaults no (Boolean).
* '''Owner''': Required; username for accountability (Text).
* '''URL''': Optional; external link (URL).
* '''Author''': Optional; original creator (Text).
* '''Original Title''': Optional; source title (Text).
* '''Original Source''': Optional; e.g., Book|Article (Text; controlled vocab via forms).
* '''Content''': Auto-passed; main body wikitext.


=== Parameters ===
=== Validation ===
* '''Image''': The filename of the main image (e.g., "My_Awesome_Image.jpg").
- **Test Query**: On a sample page: `[[Has topic tag::Tag:Habits]] [[Has status::Published]]`—should annotate correctly, queryable via API.
* '''Display Title''': The primary title shown to users.
- **Edge Case**: Empty tags defaults to no property (avoids blank arrays); boolean false hides from featured lists.
* '''Subtitle''': The secondary title or tagline.
* '''Knowledge Format''': The format of the entry (e.g., [[Guide]]). Must be a link to the format's page.
* '''Author''': The author of the original work, if applicable.
* '''Original Title''': The title of the original work being summarized.
* '''Original Source''': The source type (Book, Article, etc.), from a controlled list.
* '''URL''': An external link related to the content.
* '''Topic Tags''': A comma-separated list of links to topic pages (e.g., [[Habits]], [[Deep Work]]). This is critical for discovery.
* '''Status''': The publication status (Published, Draft, Archived). Defaults to "Published".
* '''Is Featured''': A "yes" or "no" flag to feature the content. Defaults to "no".
* '''Description''': The short summary used on content cards.
* '''Content''': This parameter is reserved for the main body of the article, passed in from a format-specific template.


Next: Audit format-specific wrappers (e.g., Template:Summary)?
</noinclude>
</noinclude>

Revision as of 06:01, 21 September 2025

Template:Knowledge

Master template for Knowledge entries—call via format wrappers only (e.g.,

No image provided


Format Summaries






Summaries


{{#if:|}




{{#if:|[[Has image::File:}]}

false

{{#if:|}


). Handles infobox and shared semantics for headless API pulls.

Parameters

  • Display Title: Required; user-facing title (Text).
  • Subtitle: Optional; tagline (Text).
  • Description: Optional; card teaser (Text).
  • Image: Optional; filename, auto-prefixes File: (File).
  • Knowledge Format: Auto-passed by wrapper (Page; controlled: Guides|Summaries|etc.).
  • Topic Tags: Required; comma-separated Tag: pages (e.g., Tag:Habits,Tag:Productivity) for multi-value filtering (Page).
  • Status: Publication state; defaults Draft (Text; controlled: Draft|Published|Archived).
  • Is Featured: yes/no flag; defaults no (Boolean).
  • Owner: Required; username for accountability (Text).
  • URL: Optional; external link (URL).
  • Author: Optional; original creator (Text).
  • Original Title: Optional; source title (Text).
  • Original Source: Optional; e.g., Book|Article (Text; controlled vocab via forms).
  • Content: Auto-passed; main body wikitext.

Validation

- **Test Query**: On a sample page: `Tag:Habits Published`—should annotate correctly, queryable via API. - **Edge Case**: Empty tags defaults to no property (avoids blank arrays); boolean false hides from featured lists.

Next: Audit format-specific wrappers (e.g., Template:Summary)?