Template:Knowledge: Difference between revisions
Appearance
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
<includeonly> | <includeonly> | ||
<!-- | <!-- | ||
================================================================== | ================================================================== | ||
== VISIBLE INFOBOX - | == VISIBLE INFOBOX - Conditional display for wiki/admin views. | ||
================================================================== | ================================================================== | ||
--> | --> | ||
{| 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 - | == HIDDEN SEMANTIC DATA - Single source for API queries. | ||
================================================================== | ================================================================== | ||
--> | --> | ||
<div style="display:none;"> | <div style="display:none;"> | ||
[[Category:Knowledge]] | [[Category:Knowledge]] | ||
<!-- | <!-- RECOMMENDED: Do NOT set Belongs to platform section here (Topic Cards decide hub placement). --> | ||
[[Has status::{{{Status| | <!-- 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}}}]]}} | ||
<!-- | <!-- 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:{{{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}}}}}}]} | |||
<!-- | <!-- Boolean (true/false for queries) --> | ||
[[Is featured::{{#ifeq:{{lc:{{{Is Featured|no}}}}}|yes| | [[Is featured::{{#ifeq:{{lc:{{{Is Featured|no}}}}}|yes|true|false}}]] | ||
<!-- | <!-- 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 | == CONTENT - Populated by format-specific wrappers (e.g., Template:Summary). | ||
================================================================== | ================================================================== | ||
--> | --> | ||
{{{Content|}}} | {{{Content|}}} | ||
</includeonly><noinclude> | </includeonly><noinclude> | ||
'''Template:Knowledge''' | '''Template:Knowledge''' | ||
Master template for Knowledge entries—call via format wrappers only (e.g., {{Summary}}). 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: `[[Has topic tag::Tag:Habits]] [[Has status::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)? | |||
</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
|
|---|---|
). 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)?