Jump to content

Template:Resource: Difference between revisions

From WYOS Wiki
No edit summary
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 33: Line 33:
}}
}}
{{#if:{{{Topic Tags|}}}|
{{#if:{{{Topic Tags|}}}|
{{!}}-
{{!}}-
! Topics
! Topics
{{!}} {{#show: {{FULLPAGENAME}} |?Has topic tag}}
{{!}} {{#arraymap:{{{Topic Tags}}}|,|x|[[x|{{#replace:x|Tag:|}}]]|, }}
}}
}}
{{#if:{{{Status|}}}|
{{#if:{{{Status|}}}|
{{!}}-
{{!}}-
Line 96: Line 97:
<!-- 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 -->
{{#if:{{{Topic Tags|}}}
{{#if:{{{Topic Tags|}}}
  | [[Has topic tag::{{{Topic Tags}}}|+sep=,]]
  | {{#arraymap:{{{Topic Tags}}}|,|x|[[Has topic tag::x]]|\s}}
}}
}}
</div>
</div>
Line 112: Line 112:
<templatedata>
<templatedata>
{
{
  "params": {
"params": {
    "Image": {
"Image": {
      "label": "Image",
"label": "Image",
      "description": "Filename of the image for the infobox (e.g., \"Tool_Logo.png\").",
"description": "Filename of the image for the infobox (e.g., \"Tool_Logo.png\").",
      "type": "wiki-file-name"
"type": "wiki-file-name"
    },
},
    "Display Title": {
"Display Title": {
      "label": "Display Title",
"label": "Display Title",
      "description": "Primary, user-facing title of the resource.",
"description": "Primary, user-facing title of the resource.",
      "type": "line"
"type": "line"
    },
},
    "Subtitle": {
"Subtitle": {
      "label": "Subtitle",
"label": "Subtitle",
      "description": "Short descriptive tagline.",
"description": "Short descriptive tagline.",
      "type": "line"
"type": "line"
    },
},
    "Resource Type": {
"Resource Type": {
      "label": "Resource Type",
"label": "Resource Type",
      "description": "Type of resource (e.g., Book, App, Course). Set by wrapper templates.",
"description": "Type of resource (e.g., Book, App, Course). Set by wrapper templates.",
      "type": "wiki-page-name"
"type": "wiki-page-name"
    },
},
    "Author": {
"Author": {
      "label": "Author/Creator",
"label": "Author/Creator",
      "description": "Creator, publisher, or vendor as appropriate.",
"description": "Creator, publisher, or vendor as appropriate.",
      "type": "line"
"type": "line"
    },
},
    "URL": {
"URL": {
      "label": "URL",
"label": "URL",
      "description": "Primary external link (homepage, store page, etc.).",
"description": "Primary external link (homepage, store page, etc.).",
      "type": "url"
"type": "url"
    },
},
    "Topic Tags": {
"Topic Tags": {
      "label": "Topic Tags",
"label": "Topic Tags",
      "description": "Comma-separated Topic Tags. Enter either \"Tag:Habits, Tag:Productivity\" or \"Habits, Productivity\".",
"description": "Comma-separated Topic Tags. Enter either \"Tag:Habits, Tag:Productivity\" or \"Habits, Productivity\".",
      "type": "line",
"type": "line",
      "required": true
"required": true
    },
},
    "Status": {
"Status": {
      "label": "Status",
"label": "Status",
      "description": "Publication status. Only Published should surface on the front end.",
"description": "Publication status. Only Published should surface on the front end.",
      "type": "line",
"type": "line",
      "suggestedvalues": ["Draft","Published","Archived"],
"suggestedvalues": [
      "default": "Draft",
"Draft",
      "required": true
"Published",
    },
"Archived"
    "Is Featured": {
],
      "label": "Featured?",
"default": "Draft",
      "description": "Set to 'yes' to highlight this item.",
"required": true
      "type": "boolean"
},
    },
"Is Featured": {
    "Owner": {
"label": "Featured?",
      "label": "Owner",
"description": "Set to 'yes' to highlight this item.",
      "description": "Responsible username (no \"User:\" prefix).",
"type": "boolean"
      "type": "wiki-user-name",
},
      "required": true
"Owner": {
    },
"label": "Owner",
    "Description": {
"description": "Responsible username (no \"User:\" prefix).",
      "label": "Description",
"type": "wiki-user-name",
      "description": "Short 1–2 sentence summary shown on cards and lists.",
"required": true
      "type": "string",
},
      "required": true
"Description": {
    },
"label": "Description",
    "Content": {
"description": "Short 1–2 sentence summary shown on cards and lists.",
      "label": "Main Content",
"type": "string",
      "description": "Body content; wikitext/VisualEditor supported.",
"required": true
      "type": "content",
},
      "suggested": true
"Content": {
    }
"label": "Main Content",
  },
"description": "Body content; wikitext/VisualEditor supported.",
  "description": "Master template for all Resource entries. Use via type-specific wrappers (e.g., Book, App).",
"type": "content",
  "format": "block"
"suggested": true
}
},
"description": "Master template for all Resource entries. Use via type-specific wrappers (e.g., Book, App).",
"format": "block"
}
}
</templatedata></noinclude>
</templatedata>
</noinclude>

Latest revision as of 19:46, 23 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