Jump to content

Template:Resource: Difference between revisions

From WYOS Wiki
No edit summary
No edit summary
Line 35: Line 35:
{{!}}-
{{!}}-
! Topics
! Topics
{{!}} {{#arraymap:{{{Topic Tags|}}}|,|t|
{{!}} {{#show: {{FULLPAGENAME}} |?Has topic tag}}
  {{#ifeq:{{lc:{{#titleparts:{{#trim:t}}|1|1}}}}|tag
    | [[{{#trim:t}}|{{#replace:{{#trim:t}}|Tag:|}}]]
    | [[Tag:{{#trim:t}}|{{#trim:t}}]]
  }}
|, }}
}}
}}
{{#if:{{{Status|}}}|
{{#if:{{{Status|}}}|
Line 63: Line 58:
}}
}}
|}
|}
<!--
<!--
   ==================================================================
   ==================================================================
Line 71: Line 65:
<div style="display:none;">
<div style="display:none;">
[[Category:Resources]]
[[Category:Resources]]
<!-- Set controlled vocabulary properties. Default status is 'Draft'. -->
<!-- Set controlled vocabulary properties. Default status is 'Draft'. -->
[[Has status::{{{Status|Draft}}}]]
[[Has status::{{{Status|Draft}}}]]
Line 77: Line 70:
  | [[Has resource type::{{{Resource Type}}}]]
  | [[Has resource type::{{{Resource Type}}}]]
}}
}}
<!-- Set standard properties only if a value is provided. -->
<!-- Set standard properties only if a value is provided. -->
{{#if:{{{Display Title|}}}
{{#if:{{{Display Title|}}}
Line 94: Line 86:
  | [[Has author::{{{Author}}}]]
  | [[Has author::{{{Author}}}]]
}}
}}
<!-- Robust Owner Handling: Adds 'User:' prefix only if it's missing. -->
<!-- Robust Owner Handling: Adds 'User:' prefix only if it's missing. -->
{{#if:{{{Owner|}}}
{{#if:{{{Owner|}}}
  | [[Has owner::{{#ifeq:{{lc:{{#titleparts:{{{Owner}}}|1|1}}}}|user|{{{Owner}}}|User:{{{Owner}}}}}]]
  | [[Has owner::{{#ifeq:{{lc:{{#titleparts:{{{Owner}}}|1|1}}}}|user|{{{Owner}}}|User:{{{Owner}}}}}]]
}}
}}
<!-- Robust image handling: adds 'File:' prefix only if user forgets it. -->
<!-- Robust image handling: adds 'File:' prefix only if user forgets it. -->
{{#if:{{{Image|}}}
{{#if:{{{Image|}}}
  | [[Has image::{{#ifeq:{{lc:{{#titleparts:{{{Image}}}|1|1}}}}|file|{{{Image}}}|File:{{{Image}}}}}]]
  | [[Has image::{{#ifeq:{{lc:{{#titleparts:{{{Image}}}|1|1}}}}|file|{{{Image}}}|File:{{{Image}}}}}]]
}}
}}
<!-- Set boolean property to return true/false for the API. -->
<!-- Set boolean property to return true/false for the API. -->
[[Is featured::{{#ifeq:{{lc:{{{Is Featured|no}}}}}|yes|true|false}}]]
[[Is featured::{{#ifeq:{{lc:{{{Is Featured|no}}}}}|yes|true|false}}]]
 
<!-- Set multi-value Page property by splitting the comma-separated input from the form -->
<!-- Normalize Topic Tags to Tag: namespace and set multi-value Page property -->
{{#if:{{{Topic Tags|}}}
{{#if:{{{Topic Tags|}}}
  | {{#arraymap:{{{Topic Tags|}}}|,|t|
  | [[Has topic tag::{{{Topic Tags}}}|+sep=,]]
    [[Has topic tag::{{#ifeq:{{lc:{{#titleparts:{{#trim:t}}|1|1}}}}|tag
      | {{#trim:t}}
      | Tag:{{#trim:t}}
    }}]]
  }}
}}
}}
</div>
</div>
<!--
<!--
   ==================================================================
   ==================================================================
Line 125: Line 107:
-->
-->
{{{Content|}}}
{{{Content|}}}
</includeonly><noinclude>
</includeonly><noinclude>
'''Template:Resource'''
'''Template:Resource'''
Master template for Resource entries. Call via type wrappers only (e.g., <nowiki>{{Book|…}}</nowiki>). Handles infobox and shared semantics for headless API pulls.
Master template for Resource entries. Call via type wrappers only (e.g., <nowiki>{{Book|…}}</nowiki>). Handles infobox and shared semantics for headless API pulls.
<templatedata>
<templatedata>

Revision as of 02:04, 22 September 2025

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

Master template for all Resource entries. Use via type-specific wrappers (e.g., Book, App).

Template parameters[Edit template data]

This template prefers block formatting of parameters.

ParameterDescriptionTypeStatus
ImageImage

Filename of the image for the infobox (e.g., "Tool_Logo.png").

Fileoptional
Display TitleDisplay Title

Primary, user-facing title of the resource.

Lineoptional
SubtitleSubtitle

Short descriptive tagline.

Lineoptional
Resource TypeResource Type

Type of resource (e.g., Book, App, Course). Set by wrapper templates.

Page nameoptional
Author/CreatorAuthor

Creator, publisher, or vendor as appropriate.

Lineoptional
URLURL

Primary external link (homepage, store page, etc.).

URLoptional
Topic TagsTopic Tags

Comma-separated Topic Tags. Enter either "Tag:Habits, Tag:Productivity" or "Habits, Productivity".

Linerequired
StatusStatus

Publication status. Only Published should surface on the front end.

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

Set to 'yes' to highlight this item.

Booleanoptional
OwnerOwner

Responsible username (no "User:" prefix).

Userrequired
DescriptionDescription

Short 1–2 sentence summary shown on cards and lists.

Stringrequired
Main ContentContent

Body content; wikitext/VisualEditor supported.

Contentsuggested