Template: ResearchProject: Difference between revisions

From Innovation
Jump to: navigation, search
Created page with "<noinclude> == Usage == A template for organizing research project information. Call it at the top of each project page like this: <pre> {{ResearchProject | ProjectName = Full official project name | StartDate = 2024-06 | EndDate = 2025-01 | FundingAgency = National Research Foundation of Korea | FundingProgram = LINC 3.0 | GovernmentMinistry = Ministry of Education }} </pre> Dates are stored as SMW Date type, so the <code>YYYY-MM</c..."
 
No edit summary
Line 1: Line 1:
<noinclude>
<noinclude>
== Usage ==
== Usage ==
A template for organizing research project information. Call it at the top of each project page like this:
A modern, badge-styled infobox for research project pages.


<pre>
<pre>
Line 14: Line 14:
</pre>
</pre>


Dates are stored as SMW Date type, so the <code>YYYY-MM</code> format is recommended.
The status badge (진행 중 / 종료 / 예정) is computed automatically from <code>StartDate</code> and <code>EndDate</code> by comparing them to the current year/month. <code>YYYY-MM</code> format is required for status detection to work.
 
This template requires the [[mw:Extension:ParserFunctions|ParserFunctions]] and [[mw:Extension:StringFunctions|StringFunctions]] extensions (or [[mw:Extension:Variables|Variables]]) for the status logic. Most modern MediaWiki installs already include them. If <code>{{#replace:}}</code> or <code>{{#vardefine:}}</code> appear as raw text on the rendered page, those extensions need to be enabled.


== SMW properties ==
== SMW properties ==
This template sets the following properties. Display labels are in Korean, but the SMW property names are in English.
* [[Property:ProjectName]] (Text) — 연구과제명
* [[Property:ProjectName]] (Text) — 연구과제명
* [[Property:StartDate]] (Date) — 연구시작일
* [[Property:StartDate]] (Date) — 연구시작일
Line 27: Line 27:


[[Category:Templates]]
[[Category:Templates]]
</noinclude><includeonly>{| class="wikitable" style="float:right; margin-left:1em; min-width:320px; max-width:420px;"
</noinclude><includeonly><div style="background:#ffffff; border:1px solid #e5e5e0; border-radius:12px; padding:24px 26px; margin:0 0 1.5em; max-width:760px;">{{#vardefine:_now|{{#expr: {{CURRENTYEAR}} * 100 + {{CURRENTMONTH1}} }}}}{{#vardefine:_start|{{#expr: {{#replace:{{{StartDate|0}}}|-|}} + 0 }}}}{{#vardefine:_end|{{#expr: {{#replace:{{{EndDate|0}}}|-|}} + 0 }}}}{{#switch: {{#ifexpr: {{#var:_start}} > {{#var:_now}} | upcoming | {{#ifexpr: {{#var:_end}} < {{#var:_now}} | ended | active }} }}
|+ '''{{{ProjectName|{{PAGENAME}}}}}'''
| active  = <span style="display:inline-block; padding:3px 10px; font-size:11px; font-weight:500; border-radius:999px; background:#E1F5EE; color:#0F6E56; margin-bottom:8px;">● 진행 중</span>
|-
| ended    = <span style="display:inline-block; padding:3px 10px; font-size:11px; font-weight:500; border-radius:999px; background:#f1efe8; color:#5F5E5A; margin-bottom:8px;">● 종료</span>
! style="width:8em;" | 연구과제명
| upcoming = <span style="display:inline-block; padding:3px 10px; font-size:11px; font-weight:500; border-radius:999px; background:#FAEEDA; color:#854F0B; margin-bottom:8px;">● 예정</span>
| [[ProjectName::{{{ProjectName|{{PAGENAME}}}}}]]
}}
|-
 
! 연구기간
<div style="font-size:18px; font-weight:500; line-height:1.4; margin:0 0 4px; color:#1a1a1a;">[[ProjectName::{{{ProjectName|{{PAGENAME}}}}}]]</div>
| [[StartDate::{{{StartDate|}}}]] ~ [[EndDate::{{{EndDate|}}}]]
 
|-
<div style="font-size:13px; color:#666; margin:0 0 22px;">[[StartDate::{{{StartDate|}}}]] ~ [[EndDate::{{{EndDate|}}}]]</div>
! 지원기관
 
| [[FundingAgency::{{{FundingAgency|}}}]]
<div style="display:grid; grid-template-columns:repeat(auto-fit, minmax(160px, 1fr)); gap:10px;">
|-
<div style="background:#f1efe8; border-radius:8px; padding:12px 14px;">
! 지원사업
<div style="font-size:11px; color:#888780; margin:0 0 4px;">지원기관</div>
| [[FundingProgram::{{{FundingProgram|}}}]]
<div style="font-size:13px; font-weight:500; color:#1a1a1a; line-height:1.35;">[[FundingAgency::{{{FundingAgency|}}}]]</div>
|-
</div>
! 소관부처
<div style="background:#f1efe8; border-radius:8px; padding:12px 14px;">
| [[GovernmentMinistry::{{{GovernmentMinistry|}}}]]
<div style="font-size:11px; color:#888780; margin:0 0 4px;">지원사업</div>
|}
<div style="font-size:13px; font-weight:500; color:#1a1a1a; line-height:1.35;">[[FundingProgram::{{{FundingProgram|}}}]]</div>
[[Category:Research project]]</includeonly>
</div>
<div style="background:#f1efe8; border-radius:8px; padding:12px 14px;">
<div style="font-size:11px; color:#888780; margin:0 0 4px;">소관부처</div>
<div style="font-size:13px; font-weight:500; color:#1a1a1a; line-height:1.35;">[[GovernmentMinistry::{{{GovernmentMinistry|}}}]]</div>
</div>
</div>
</div>[[Category:Research project]]</includeonly>

Revision as of 00:08, 4 May 2026

Usage

A modern, badge-styled infobox for research project pages.

{{ResearchProject
| ProjectName        = Full official project name
| StartDate          = 2024-06
| EndDate            = 2025-01
| FundingAgency      = National Research Foundation of Korea
| FundingProgram     = LINC 3.0
| GovernmentMinistry = Ministry of Education
}}

The status badge (진행 중 / 종료 / 예정) is computed automatically from StartDate and EndDate by comparing them to the current year/month. YYYY-MM format is required for status detection to work.

This template requires the ParserFunctions and StringFunctions extensions (or Variables) for the status logic. Most modern MediaWiki installs already include them. If {{#replace:}} or {{#vardefine:}} appear as raw text on the rendered page, those extensions need to be enabled.

SMW properties