Template:Global News: Difference between revisions

From aquila
Jump to navigation Jump to search
mNo edit summary
m Replaced content with "<includeonly>{{#invoke:Timeline|render|Category=Global}}</includeonly><noinclude>{{News Timeline/doc}}</noinclude>"
Tag: Replaced
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly><tr>
<includeonly>{{#invoke:Timeline|render|Category=Global}}</includeonly><noinclude>{{News Timeline/doc}}</noinclude>
  <th colspan="4" style="background-color: #f1f5f9; color: #0b132b; text-align: center; font-weight: bold; padding: 6px;">GLOBAL NEWS</th>
</tr>
 
<!-- MACRO FOR DAY ROWS -->
{{#define: RENDER_DAY |
  {{#if: {{{Day{{{1}}}_P1|}}} |
    <tr>
      <td rowspan="{{#expr: 1 + {{#if:{{{Day{{{1}}}_P2|}}}|1|0}} + {{#if:{{{Day{{{1}}}_P3|}}}|1|0}} + {{#if:{{{Day{{{1}}}_P4|}}}|1|0}} + {{#if:{{{Day{{{1}}}_P5|}}}|1|0}} + {{#if:{{{Day{{{1}}}_P6|}}}|1|0}} + {{#if:{{{Day{{{1}}}_P7|}}}|1|0}} + {{#if:{{{Day{{{1}}}_P8|}}}|1|0}} + {{#if:{{{Day{{{1}}}_P9|}}}|1|0}} }}">{{{2}}}, Year {{{Year|1}}}</td>
      <td>{{{Day{{{1}}}_P1}}}</td>
      <td>{{{Day{{{1}}}_C1|}}}</td>
      <td rowspan="{{#expr: 1 + {{#if:{{{Day{{{1}}}_P2|}}}|1|0}} + {{#if:{{{Day{{{1}}}_P3|}}}|1|0}} + {{#if:{{{Day{{{1}}}_P4|}}}|1|0}} + {{#if:{{{Day{{{1}}}_P5|}}}|1|0}} + {{#if:{{{Day{{{1}}}_P6|}}}|1|0}} + {{#if:{{{Day{{{1}}}_P7|}}}|1|0}} + {{#if:{{{Day{{{1}}}_P8|}}}|1|0}} + {{#if:{{{Day{{{1}}}_P9|}}}|1|0}} }}">{{#time: d/m/y | 2026-07-28 + {{#expr: ({{{Year|1}}} - 1) * 14 + {{{3}}}}} days }}</td>
    </tr>
    {{#if: {{{Day{{{1}}}_P2|}}} | <tr><td>{{{Day{{{1}}}_P2}}}</td><td>{{{Day{{{1}}}_C2|}}}</td></tr> }}
    {{#if: {{{Day{{{1}}}_P3|}}} | <tr><td>{{{Day{{{1}}}_P3}}}</td><td>{{{Day{{{1}}}_C3|}}}</td></tr> }}
    {{#if: {{{Day{{{1}}}_P4|}}} | <tr><td>{{{Day{{{1}}}_P4}}}</td><td>{{{Day{{{1}}}_C4|}}}</td></tr> }}
    {{#if: {{{Day{{{1}}}_P5|}}} | <tr><td>{{{Day{{{1}}}_P5}}}</td><td>{{{Day{{{1}}}_C5|}}}</td></tr> }}
    {{#if: {{{Day{{{1}}}_P6|}}} | <tr><td>{{{Day{{{1}}}_P6}}}</td><td>{{{Day{{{1}}}_C6|}}}</td></tr> }}
    {{#if: {{{Day{{{1}}}_P7|}}} | <tr><td>{{{Day{{{1}}}_P7}}}</td><td>{{{Day{{{1}}}_C7|}}}</td></tr> }}
    {{#if: {{{Day{{{1}}}_P8|}}} | <tr><td>{{{Day{{{1}}}_P8}}}</td><td>{{{Day{{{1}}}_C8|}}}</td></tr> }}
    {{#if: {{{Day{{{1}}}_P9|}}} | <tr><td>{{{Day{{{1}}}_P9}}}</td><td>{{{Day{{{1}}}_C9|}}}</td></tr> }}
  }}
}}
 
<!-- DAYS 1 TO 14 -->
{{#if: {{{RangeLabel|}}} | |
  {{#call: RENDER_DAY | 1 | Early January | 0 }}
  {{#call: RENDER_DAY | 2 | January--February | 1 }}
  {{#call: RENDER_DAY | 3 | February--March | 2 }}
  {{#call: RENDER_DAY | 4 | March--April | 3 }}
  {{#call: RENDER_DAY | 5 | April--May | 4 }}
  {{#call: RENDER_DAY | 6 | May--June | 5 }}
  {{#call: RENDER_DAY | 7 | June | 6 }}
  {{#call: RENDER_DAY | 8 | June--July | 7 }}
  {{#call: RENDER_DAY | 9 | July--August | 8 }}
  {{#call: RENDER_DAY | 10 | August--September | 9 }}
  {{#call: RENDER_DAY | 11 | September--October | 10 }}
  {{#call: RENDER_DAY | 12 | October--November | 11 }}
  {{#call: RENDER_DAY | 13 | November--December | 12 }}
  {{#call: RENDER_DAY | 14 | Late December | 13 }}
}}
 
<!-- RANGE OVERRIDE FOR CONSECUTIVE EMPTY DAYS -->
{{#if: {{{RangeLabel|}}} |
  <tr>
    <td>{{{RangeLabel}}}</td>
    <td></td>
    <td></td>
    <td>{{#time: d/m/y | 2026-07-28 + {{#expr: ({{{Year|1}}} - 1) * 14 + ({{{RangeStartDay|3}}} - 1)}} days }} to {{#time: d/m/y | 2026-07-28 + {{#expr: ({{{Year|1}}} - 1) * 14 + ({{{RangeEndDay|7}}} - 1)}} days }}</td>
  </tr>
}}</includeonly><noinclude>
<div style="background-color: #fffbeb; border-left: 4px solid #f59e0b; padding: 12px; margin-bottom: 1.5em; border-radius: 4px;">
<strong style="color: #b45309;">GLOBAL NEWS TIMELINE TEMPLATE</strong>
<p style="margin: 4px 0 0 0; color: #78350f; font-size: 0.95em;">Automated news section for Global News. Supports up to 9 posts per day and auto-calculates real dates based on the <code>Year</code> parameter.</p>
</div>
 
== Usage ==
<pre>
{{Global News
| Year = 6
 
| Day1_P1 = ''Year 6 Begins'' | Day1_C1 =
| Day1_P2 = [[Kheta-Kedet/Who Are You|Who Are You]] | Day1_C2 = [[Kheta-Kedet]]
 
| Day2_P1 = [[Republic of Calaveria/Escape|Escape of Roulette]] | Day2_C1 = [[Republic of Calaveria]]
 
| RangeLabel = February--March to June, Year 6
| RangeStartDay = 3
| RangeEndDay = 7
}}
</pre>
 
== TemplateData ==
<templatedata>
{
"description": "Renders the Global News timeline section for Era Nova year pages.",
"params": {
"Year": {
"label": "Lore Year",
"description": "The current lore year number (e.g. 6). Auto-calculates real-world dates.",
"type": "number",
"required": true
},
"Day1_P1": { "label": "Day 1 - Post 1", "type": "string" },
"Day1_C1": { "label": "Day 1 - Post 1 Author/Nation", "type": "string" },
"Day1_P2": { "label": "Day 1 - Post 2", "type": "string" },
"Day1_C2": { "label": "Day 1 - Post 2 Author/Nation", "type": "string" },
"RangeLabel": { "label": "Merged Range Label", "type": "string" },
"RangeStartDay": { "label": "Range Start Day (1-14)", "type": "number" },
"RangeEndDay": { "label": "Range End Day (1-14)", "type": "number" }
}
}
</templatedata>
</noinclude>

Latest revision as of 21:28, 23 October 2026

This is the shared documentation and TemplateData for the three news timeline templates (Template:Global News, Template:Domestic News, Template:Character News). Each adds one table to an Era Nova year page. They are powered by Module:Timeline and Module:Calendar.

How to use

{{Global News
| Year = 1
}}

That is all most year pages need: every post written with {{News Header}} appears here automatically, on the day its RealDate falls in, and days with nothing are merged into one row.

Events that have no page of their own

For something staff-only (like "Era Nova Begins") fill in the day's box, one event per line:

Post title; Character or nation; optional real-world date
{{Global News
| Year = 1
| Day1 = <span>Era Nova Begins</span>
}}

A plain name becomes a link automatically; wrap it in <span>...</span> to keep plain text. If a typed line is for a post that also has a page, the typed line is dropped so nothing appears twice.

Notes

  • A post only appears if it uses {{News Header}} with a valid RealDate.
  • Year pages are cached: after a new post is saved, purge the year page to see it straight away.
  • Auto=no turns the automatic list off (handy for testing).

Adds one news section (Global, Domestic or Character) to an Era Nova year page. Posts that use {{News Header}} are listed automatically; empty days are merged.

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
Lore yearYear

The Era Nova year as a whole number (1, 2, 3...).

Example
1
Numberrequired
Extra events, day 1: Early JanuaryDay1

Only for events that do NOT have their own page. Posts that use {{News Header}} appear automatically. One event per line: Post title; Character or nation; optional real-world date.

Example
Era Nova Begins; High Council
Stringoptional
Extra events, day 2: January–FebruaryDay2

Only for events that do NOT have their own page. Posts that use {{News Header}} appear automatically. One event per line: Post title; Character or nation; optional real-world date.

Example
Era Nova Begins; High Council
Stringoptional
Extra events, day 3: February–MarchDay3

Only for events that do NOT have their own page. Posts that use {{News Header}} appear automatically. One event per line: Post title; Character or nation; optional real-world date.

Example
Era Nova Begins; High Council
Stringoptional
Extra events, day 4: March–AprilDay4

Only for events that do NOT have their own page. Posts that use {{News Header}} appear automatically. One event per line: Post title; Character or nation; optional real-world date.

Example
Era Nova Begins; High Council
Stringoptional
Extra events, day 5: April–MayDay5

Only for events that do NOT have their own page. Posts that use {{News Header}} appear automatically. One event per line: Post title; Character or nation; optional real-world date.

Example
Era Nova Begins; High Council
Stringoptional
Extra events, day 6: May–JuneDay6

Only for events that do NOT have their own page. Posts that use {{News Header}} appear automatically. One event per line: Post title; Character or nation; optional real-world date.

Example
Era Nova Begins; High Council
Stringoptional
Extra events, day 7: JuneDay7

Only for events that do NOT have their own page. Posts that use {{News Header}} appear automatically. One event per line: Post title; Character or nation; optional real-world date.

Example
Era Nova Begins; High Council
Stringoptional
Extra events, day 8: June–JulyDay8

Only for events that do NOT have their own page. Posts that use {{News Header}} appear automatically. One event per line: Post title; Character or nation; optional real-world date.

Example
Era Nova Begins; High Council
Stringoptional
Extra events, day 9: July–AugustDay9

Only for events that do NOT have their own page. Posts that use {{News Header}} appear automatically. One event per line: Post title; Character or nation; optional real-world date.

Example
Era Nova Begins; High Council
Stringoptional
Extra events, day 10: August–SeptemberDay10

Only for events that do NOT have their own page. Posts that use {{News Header}} appear automatically. One event per line: Post title; Character or nation; optional real-world date.

Example
Era Nova Begins; High Council
Stringoptional
Extra events, day 11: September–OctoberDay11

Only for events that do NOT have their own page. Posts that use {{News Header}} appear automatically. One event per line: Post title; Character or nation; optional real-world date.

Example
Era Nova Begins; High Council
Stringoptional
Extra events, day 12: October–NovemberDay12

Only for events that do NOT have their own page. Posts that use {{News Header}} appear automatically. One event per line: Post title; Character or nation; optional real-world date.

Example
Era Nova Begins; High Council
Stringoptional
Extra events, day 13: November–DecemberDay13

Only for events that do NOT have their own page. Posts that use {{News Header}} appear automatically. One event per line: Post title; Character or nation; optional real-world date.

Example
Era Nova Begins; High Council
Stringoptional
Extra events, day 14: Late DecemberDay14

Only for events that do NOT have their own page. Posts that use {{News Header}} appear automatically. One event per line: Post title; Character or nation; optional real-world date.

Example
Era Nova Begins; High Council
Stringoptional
Read posts automaticallyAuto

Leave blank to list posts from the news database. Write 'no' to show only the lines typed here.

Suggested values
no
Stringoptional