Jump to content

Template:Knowledge: Difference between revisions

From WYOS Wiki
No edit summary
No edit summary
 
(15 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>
<includeonly>
<!--  
<!--
   ==================================================================
   ==================================================================
   == VISIBLE INFOBOX - This section only displays data.
   == VISIBLE INFOBOX - For display on the wiki page only.
  == 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}}}
{{!}} {{#arraymap:{{{Topic Tags|}}}|,|x|[[x|{{#replace:x|Tag:|}}]]|,&#32;}}
}}
}}
{{#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 - The single source of truth for your headless CMS.
  == 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 -->
<!-- Set controlled vocabulary properties. Default status is 'Draft'. -->
[[Has status::{{{Status|Published}}}]]
[[Has status::{{{Status|Draft}}}]]
{{#if:{{{Knowledge Format|}}}|[[Has knowledge format::{{{Knowledge Format}}}]]}}
{{#if:{{{Knowledge Format|}}}
{{#if:{{{Original Source|}}}|[[Has original source::{{{Original Source}}}]]}}
| [[Has knowledge format::{{{Knowledge Format}}}]]
}}
{{#if:{{{Original Source|}}}
| [[Has original source::{{{Original Source}}}]]
}}
 
<!-- Set standard properties only if a value is provided. -->
{{#if:{{{Display Title|}}}
| [[Has display title::{{{Display Title}}}]]
}}
{{#if:{{{Subtitle|}}}
| [[Has subtitle::{{{Subtitle}}}]]
}}
{{#if:{{{Description|}}}
| [[Has description::{{{Description}}}]]
}}
{{#if:{{{URL|}}}
| [[Has url::{{{URL}}}]]
}}
{{#if:{{{Author|}}}
| [[Has author::{{{Author}}}]]
}}
{{#if:{{{Original Title|}}}
| [[Has original title::{{{Original Title}}}]]
}}
 
<!-- Robust Owner Handling: Adds 'User:' prefix only if it's missing. -->
{{#if:{{{Owner|}}}
| [[Has owner::{{#ifeq:{{lc:{{#titleparts:{{{Owner}}}|1|1}}}}|user|{{{Owner}}}|User:{{{Owner}}}}}]]
}}


<!-- Set standard properties only if a value is provided -->
<!-- Robust image handling: adds 'File:' prefix only if user forgets it. -->
{{#if:{{{Display Title|}}}|[[Has display title::{{{Display Title}}}]]}}
{{#if:{{{Image|}}}
{{#if:{{{Subtitle|}}}|[[Has subtitle::{{{Subtitle}}}]]}}
| [[Has image::{{#ifeq:{{lc:{{#titleparts:{{{Image}}}|1|1}}}}|file|{{{Image}}}|File:{{{Image}}}}}]]
{{#if:{{{Image|}}}|[[Has image::{{{Image}}}]]}}
}}
{{#if:{{{Description|}}}|[[Has description::{{{Description}}}]]}}
{{#if:{{{URL|}}}|[[Has url::{{{URL}}}]]}}
{{#if:{{{Author|}}}|[[Has author::{{{Author}}}]]}}
{{#if:{{{Original Title|}}}|[[Has original title::{{{Original Title}}}]]}}


<!-- Set boolean property -->
<!-- Set boolean property to return true/false for the API. -->
[[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 -->
<!-- Normalize Topic Tags to Tag: namespace and set multi-value Page property -->
{{#arraymap:{{{Topic Tags|}}}|,|x|[[Has topic tag::x]]}}
{{#if:{{{Topic Tags|}}}
| {{#arraymap:{{{Topic Tags|}}}|,|x|[[Has topic tag::x]]|\s}}
}}
</div>
</div>


<!--  
<!--
   ==================================================================
   ==================================================================
   == CONTENT SECTIONS - Populated by format-specific templates.
   == CONTENT - This displays the main body of the article.
  == This is where the rich text content from VEForAll will appear.
   ==================================================================
   ==================================================================
-->
-->
Line 95: Line 134:
</includeonly><noinclude>
</includeonly><noinclude>
'''Template:Knowledge'''
'''Template:Knowledge'''
 
Master template for Knowledge entries. Call via format wrappers only (e.g., <nowiki>{{Summary|…}}</nowiki>). Handles infobox and shared semantics for headless API pulls.
This is the MASTER template for all Knowledge section entries. It should NOT be called directly.
<templatedata>
This template handles the infobox display and assigns all shared semantic properties.
{
 
  "params": {
Use a format-specific wrapper template (e.g., Template:Summary), which will call this one and provide the necessary data.
    "Image": {
 
      "label": "Image",
=== Parameters ===
      "description": "The filename of the image to display in the infobox (e.g., \"My_Book_Cover.jpg\").",
* '''Image''': The filename of the main image (e.g., "My_Awesome_Image.jpg").
      "type": "wiki-file-name"
* '''Display Title''': The primary title shown to users.
    },
* '''Subtitle''': The secondary title or tagline.
    "Display Title": {
* '''Knowledge Format''': The format of the entry (e.g., [[Guide]]). Must be a link to the format's page.
      "label": "Display Title",
* '''Author''': The author of the original work, if applicable.
      "description": "The primary, user-facing title of the entry.",
* '''Original Title''': The title of the original work being summarized.
      "type": "line"
* '''Original Source''': The source type (Book, Article, etc.), from a controlled list.
    },
* '''URL''': An external link related to the content.
    "Subtitle": {
* '''Topic Tags''': A comma-separated list of links to topic pages (e.g., [[Habits]], [[Deep Work]]). This is critical for discovery.
      "label": "Subtitle",
* '''Status''': The publication status (Published, Draft, Archived). Defaults to "Published".
      "description": "A short, descriptive tagline that appears below the main title.",
* '''Is Featured''': A "yes" or "no" flag to feature the content. Defaults to "no".
      "type": "line"
* '''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.
    "Knowledge Format": {
 
      "label": "Knowledge Format",
</noinclude>
      "description": "The format of the entry. This is set automatically by the wrapper template and should not be changed.",
      "example": "Summaries",
      "type": "wiki-page-name",
      "suggestedvalues": [
        "Summaries",
        "Guides",
        "Frameworks & Models",
        "Big Ideas",
        "Tips & Tactics",
        "Quick Insights",
        "Visuals"
      ],
      "suggested": true
    },
    "Author": {
      "label": "Author",
      "description": "The original creator of the work (e.g., the book's author).",
      "type": "line"
    },
    "Original Title": {
      "label": "Original Title",
      "description": "The official title of the original work being summarized.",
      "type": "line"
    },
    "Original Source": {
      "label": "Original Source",
      "description": "The type of the original work.",
      "example": "Book",
      "type": "line"
    },
    "URL": {
      "label": "URL",
      "description": "A relevant external link, such as to the original article or a purchase page.",
      "type": "url"
    },
    "Topic Tags": {
      "label": "Topic Tags",
      "description": "A comma-separated list of relevant Topic Tags. You may enter either \"Tag:Habits, Tag:Productivity\" or \"Habits, Productivity\".",
      "type": "line",
      "required": true
    },
    "Status": {
      "label": "Status",
      "description": "The publication status of the entry. \"Draft\" keeps it hidden from public view.",
      "type": "line",
      "suggestedvalues": ["Draft","Published","Archived"],
      "default": "Draft",
      "required": true
    },
    "Is Featured": {
      "label": "Featured?",
      "description": "Set to 'yes' to highlight this content on hub pages.",
      "type": "boolean"
    },
    "Owner": {
      "label": "Owner",
      "description": "The username of the person responsible for this content's accuracy (do not include the \"User:\" prefix).",
      "type": "wiki-user-name",
      "required": true
    },
    "Description": {
      "label": "Description",
      "description": "The short, 1–2 sentence summary used on content cards across the site.",
      "type": "string",
      "required": true
    },
    "Content": {
      "label": "Main Content",
      "description": "The main body of the article. This is a free-form text area that supports standard wikitext/VE.",
      "type": "content",
      "suggested": true
    }
  },
  "description": "Master template for all Knowledge entries. Handles infobox and shared semantics. Should only be called by a format-specific wrapper template.",
  "format": "block"
}
</templatedata></noinclude>

Latest revision as of 23:24, 23 September 2025

Template:Knowledge Master template for Knowledge entries. Call via format wrappers only (e.g., {{Summary|…}}). Handles infobox and shared semantics for headless API pulls.

Master template for all Knowledge entries. Handles infobox and shared semantics. Should only be called by a format-specific wrapper template.

Template parameters[Edit template data]

This template prefers block formatting of parameters.

ParameterDescriptionTypeStatus
ImageImage

The filename of the image to display in the infobox (e.g., "My_Book_Cover.jpg").

Fileoptional
Display TitleDisplay Title

The primary, user-facing title of the entry.

Lineoptional
SubtitleSubtitle

A short, descriptive tagline that appears below the main title.

Lineoptional
Knowledge FormatKnowledge Format

The format of the entry. This is set automatically by the wrapper template and should not be changed.

Suggested values
Summaries Guides Frameworks & Models Big Ideas Tips & Tactics Quick Insights Visuals
Example
Summaries
Page namesuggested
AuthorAuthor

The original creator of the work (e.g., the book's author).

Lineoptional
Original TitleOriginal Title

The official title of the original work being summarized.

Lineoptional
Original SourceOriginal Source

The type of the original work.

Example
Book
Lineoptional
URLURL

A relevant external link, such as to the original article or a purchase page.

URLoptional
Topic TagsTopic Tags

A comma-separated list of relevant Topic Tags. You may enter either "Tag:Habits, Tag:Productivity" or "Habits, Productivity".

Linerequired
StatusStatus

The publication status of the entry. "Draft" keeps it hidden from public view.

Suggested values
Draft Published Archived
Default
Draft
Linerequired
Featured?Is Featured

Set to 'yes' to highlight this content on hub pages.

Booleanoptional
OwnerOwner

The username of the person responsible for this content's accuracy (do not include the "User:" prefix).

Userrequired
DescriptionDescription

The short, 1–2 sentence summary used on content cards across the site.

Stringrequired
Main ContentContent

The main body of the article. This is a free-form text area that supports standard wikitext/VE.

Contentsuggested