Jump to content

Template:Resource: Difference between revisions

From WYOS Wiki
No edit summary
No edit summary
Line 1: Line 1:
<includeonly>
<includeonly>
{| class="wikitable" style="float:right; margin-left:1em; width:300px;"
<!--
| colspan="2" style="text-align:center;" | {{#if:{{{Image|}}}|[[File:{{{Image}}}|290px]]|''No image''}}
  ==================================================================
|-
  == VISIBLE INFOBOX - This section only displays data.
! Type
  == It does not assign any semantic properties.
| {{{Resource Type|}}}
  ==================================================================
-->
{| 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''}}
{{#if:{{{Display Title|}}}|{{!}}-
{{#if:{{{Display Title|}}}|{{!}}-
! Display Title
! Display Title
Line 11: Line 14:
{{#if:{{{Subtitle|}}}|{{!}}-
{{#if:{{{Subtitle|}}}|{{!}}-
! Subtitle
! Subtitle
{{!}} {{{Subtitle|}}}
{{!}} {{{Subtitle}}}
}}
{{#if:{{{Resource Type|}}}|{{!}}-
! Type
{{!}} {{{Resource Type}}}
}}
}}
{{#if:{{{Author|}}}|{{!}}-
{{#if:{{{Author|}}}|{{!}}-
! Author
! Author/Creator
{{!}} [[Has author::{{{Author|}}}]]
{{!}} {{{Author}}}
}}
{{#if:{{{URL|}}}|{{!}}-
! URL
{{!}} [{{{URL}}} Visit Site]
}}
}}
|-
{{#if:{{{Topic Tags|}}}|{{!}}-
! Topics
! Topics
| {{{Topic Tags|}}}
{{!}} {{{Topic Tags}}}
|-
}}
! Categories
{{#if:{{{Status|}}}|{{!}}-
| {{{Main Categories|}}}
|-
! URL
| [[Has url::{{{URL|}}}]]
|-
! Status
! Status
| [[Has status::{{{Status|Draft}}}]]
{{!}} {{{Status}}}
|-
}}
! Featured?
{{#if:{{{Is Featured|}}}|{{!}}-
| [[Is featured::{{{Is Featured|}}}]]
! Featured
{{!}} {{{Is Featured}}}
}}
{{#if:{{{Description|}}}|{{!}}-
{{#if:{{{Description|}}}|{{!}}-
! Description
! Description
Line 38: Line 46:
|}
|}


<!--
  ==================================================================
  == HIDDEN SEMANTIC DATA - This is the single source of truth for
  == assigning all semantic properties for the entry.
  ==================================================================
-->
<div style="display:none;">
<div style="display:none;">
<!-- Invisible Data Section -->
[[Category:Resources]]
[[Category:Resources]]
[[Has status::{{{Status|Draft}}}]]
[[Belongs to section::Resources]]
[[Has resource type::{{{Resource Type|}}}]]
 
[[Has display title::{{{Display Title|}}}]]
<!-- Set controlled vocabulary properties -->
[[Has image::{{{Image|}}}]]
[[Has status::{{{Status|Published}}}]]
[[Has description::{{{Description|}}}]]
{{#if:{{{Resource Type|}}}|[[Has resource type::{{{Resource Type}}}]]}}
[[Has subtitle::{{{Subtitle|}}}]]
 
<!-- Set standard properties only if a value is provided -->
{{#if:{{{Display Title|}}}|[[Has display title::{{{Display Title}}}]]}}
{{#if:{{{Subtitle|}}}|[[Has subtitle::{{{Subtitle}}}]]}}
{{#if:{{{Image|}}}|[[Has image::{{{Image}}}]]}}
{{#if:{{{Description|}}}|[[Has description::{{{Description}}}]]}}
{{#if:{{{URL|}}}|[[Has url::{{{URL}}}]]}}
{{#if:{{{Author|}}}|[[Has author::{{{Author}}}]]}}
 
<!-- Set boolean property -->
[[Is featured::{{#ifeq:{{lc:{{{Is Featured|no}}}}}|yes|yes|no}}]]
 
<!-- Set multi-value 'Page' property -->
{{#arraymap:{{{Topic Tags|}}}|,|x|[[Has topic tag::x]]}}
{{#arraymap:{{{Topic Tags|}}}|,|x|[[Has topic tag::x]]}}
{{#arraymap:{{{Main Categories|}}}|,|x|[[Belongs to main category::x]]}}
</div>
</div>
<!--
  ==================================================================
  == CONTENT SECTION - Populated by resource type-specific templates.
  ==================================================================
-->
{{{Content|}}}
</includeonly><noinclude>
</includeonly><noinclude>
This is the master template for all resources.
'''Template:Resource'''
 
This is the MASTER template for all Resource section entries. It should NOT be called directly.
This template handles the infobox display and assigns all shared semantic properties.
 
Use a type-specific wrapper template (e.g., Template:Book, Template:App), which will call this one and provide the necessary data.
 
=== Parameters ===
* '''Image''': The filename of the main image (e.g., "My_Awesome_Image.jpg").
* '''Display Title''': The primary title shown to users.
* '''Subtitle''': The secondary title or tagline.
* '''Resource Type''': The type of the resource (e.g., [[Book]]). Must be a link to the type page.
* '''Author''': The author or creator of the resource (e.g., for books, courses).
* '''URL''': The primary external link for the resource.
* '''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 resource description, passed in from a type-specific template.
 
</noinclude>
</noinclude>

Revision as of 05:26, 20 September 2025

Template:Resource

This is the MASTER template for all Resource section entries. It should NOT be called directly. This template handles the infobox display and assigns all shared semantic properties.

Use a type-specific wrapper template (e.g., Template:Book, Template:App), which will call this one and provide the necessary data.

Parameters

  • Image: The filename of the main image (e.g., "My_Awesome_Image.jpg").
  • Display Title: The primary title shown to users.
  • Subtitle: The secondary title or tagline.
  • Resource Type: The type of the resource (e.g., Book). Must be a link to the type page.
  • Author: The author or creator of the resource (e.g., for books, courses).
  • URL: The primary external link for the resource.
  • 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 resource description, passed in from a type-specific template.