Template:News Header: Difference between revisions

From aquila
Jump to navigation Jump to search
mNo edit summary
Tag: Reverted
mNo edit summary
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>{{DISPLAYTITLE:{{#titleparts:{{FULLPAGENAME}}|1|-1}}}}
<includeonly>__NOTITLE__
{{DISPLAYTITLE:{{#if:{{{Title|}}}|{{{Title}}}|{{#titleparts:{{FULLPAGENAME}}|1|-1}}}}}}
{{#cargo_store: _table=NewsPosts
{{#cargo_store: _table=NewsPosts
|Page_Name={{FULLPAGENAME}}
|Page_Name={{FULLPAGENAME}}
|Type={{{Type|Character News}}}
|Title={{#if:{{{Title|}}}|{{{Title}}}|{{#titleparts:{{FULLPAGENAME}}|1|-1}}}}
|Subheading={{{Subheading|}}}
|Type={{#invoke:Timeline|newsType|{{{Type|}}}}}
|RealDate={{{RealDate|}}}
|RealDate={{#invoke:Calendar|iso|{{{RealDate|}}}}}
|Author={{{Author|{{{Publisher|{{{Agency|{{{Publication|}}}}}}}}}}}
|Author={{{Author|}}}
|Publisher={{{Publisher|{{{Author|{{{Agency|{{{Publication|Global News}}}}}}}}}}}
|Publisher={{{Publisher|{{{Agency|{{{Publication|}}}}}}}}}
|Year=Era Nova, Year {{#expr: 1 + floor( ({{#time:U|{{{RealDate}}}}} - {{#time:U|2026-07-28}}) / 1209600 )}}
|Year={{#invoke:Calendar|yearName|{{{RealDate|}}}}}
|Period={{#switch: {{#expr: 1 + ( floor( ({{#time:U|{{{RealDate}}}}} - {{#time:U|2026-07-28}}) / 86400) mod 14 ) }}
|YearNum={{#invoke:Calendar|yearNum|{{{RealDate|}}}}}
| 1 = Early January
|Period={{#invoke:Calendar|period|{{{RealDate|}}}}}
| 2 = January--February
|DayNum={{#invoke:Calendar|dayNum|{{{RealDate|}}}}}
| 3 = February--March
}}{{#invoke:Calendar|check|{{{RealDate|}}}}}<!--
| 4 = March--April
| 5 = April--May
--><div class="aquila-news-card">
| 6 = May--June
| 7 = June
<!-- Top Header / Article Title -->
| 8 = June--July
<h2 style="border-bottom: 2px solid #e2e8f0; color: #0b132b; margin-top: 0; padding-bottom: 0.4em; font-family: 'Georgia', serif;">{{#if:{{{Title|}}}|{{{Title}}}|{{#titleparts:{{FULLPAGENAME}}|1|-1}}}}</h2>
| 9 = July--August
| 10 = August--September
<!-- News Metadata Stats Table (Full Width) -->
| 11 = September--October
<div class="aquila-news-table-box">
| 12 = October--November
| 13 = November--December
<table style="width: 100%; border-collapse: collapse;">
| 14 = Late December
<tr>
| #default = Early January
  <td style="padding: 0.3em 0.5em; font-weight: bold; width: 25%; border-bottom: 1px solid #e2e8f0;">In-universe date</td>
}}
  <td style="padding: 0.3em 0.5em; border-bottom: 1px solid #e2e8f0;">{{#if:{{#invoke:Calendar|yearNum|{{{RealDate|}}}}}|Era Nova, {{#invoke:Calendar|label|{{{RealDate|}}}}}, [[:Category:{{#invoke:Calendar|yearName|{{{RealDate|}}}}}|Year {{#invoke:Calendar|yearNum|{{{RealDate|}}}}}]]|<span style="color: #c53030; font-weight: bold;">[Check RealDate]</span>}}</td>
__NOTITLE__
</tr>
}}<!--
<tr>
 
  <td style="padding: 0.3em 0.5em; font-weight: bold; border-bottom: 1px solid #e2e8f0;">Real-world date</td>
--><div style="border: 1px solid #1a1a1a; background-color: #f8f9fa; padding: 18px 20px; margin-bottom: 1.5em; border-radius: 4px; box-shadow: 0 2px 4px rgba(0,0,0,0.1);">
  <td style="padding: 0.3em 0.5em; border-bottom: 1px solid #e2e8f0;"><span style="font-family: monospace; font-size: 0.9em;">{{#if:{{#invoke:Calendar|iso|{{{RealDate|}}}}}|{{#invoke:Calendar|iso|{{{RealDate|}}}}}|{{{RealDate|}}}}}</span></td>
 
</tr>
<!-- Main Article Title Inside Box -->
<tr>
<div style="font-size: 180%; font-family: 'Georgia', serif; font-weight: normal; margin-bottom: 8px; line-height: 1.2; color: #202122;">{{#titleparts:{{FULLPAGENAME}}|1|-1}}</div>
  <td style="padding: 0.3em 0.5em; font-weight: bold; border-bottom: 1px solid #e2e8f0;">{{#if: {{{Author|}}} | Author | Publisher }}</td>
 
  <td style="padding: 0.3em 0.5em; border-bottom: 1px solid #e2e8f0;">{{#if: {{{Author|}}} | '''[[{{{Author}}}]]''' | {{{Publisher|{{{Agency|{{{Publication|Global News}}}}}}}}} }}</td>
<!-- Optional Subheading with Conditional Divider -->
</tr>
{{#if: {{{Subheading|}}}|<div style="font-size: 130%; font-weight: bold; margin-bottom: 12px; border-top: 1px solid #c8ccd1; padding-top: 8px; border-bottom: 1px solid #c8ccd1; padding-bottom: 6px; color: #1a1a1a;">{{{Subheading}}}</div>}}
<tr>
 
  <td style="padding: 0.3em 0.5em; font-weight: bold;">Category Type</td>
<!-- Metadata Section -->
  <td style="padding: 0.3em 0.5em;">{{#invoke:Timeline|newsType|{{{Type|}}}}}</td>
<div style="font-size: 92%; color: #54595d; line-height: 1.6; {{#if: {{{Subheading|}}}||border-top: 1px solid #c8ccd1; padding-top: 12px;}}"><b>In-universe date:</b> Era Nova, {{#switch: {{#expr: 1 + ( floor( ({{#time:U|{{{RealDate}}}}} - {{#time:U|2026-07-28}}) / 86400) mod 14 ) }}
</tr>
| 1 = Early January
</table>
| 2 = January--February
| 3 = February--March
</div>
| 4 = March--April
| 5 = April--May
</div>
| 6 = May--June
| 7 = June
<!-- AUTOMATED CATEGORIZATION -->
| 8 = June--July
| 9 = July--August
| 10 = August--September
| 11 = September--October
| 12 = October--November
| 13 = November--December
| 14 = Late December
| #default = Early January
}}, [[:Category:Era Nova, Year {{#expr: 1 + floor( ({{#time:U|{{{RealDate}}}}} - {{#time:U|2026-07-28}}) / 1209600 )}}|Year {{#expr: 1 + floor( ({{#time:U|{{{RealDate}}}}} - {{#time:U|2026-07-28}}) / 1209600 )}}]]<br>
<b>Real-world date:</b> {{{RealDate}}}<br>
<b>{{#if: {{{Author|}}} | Author | Publisher }}:</b> {{#if: {{{Author|}}} | [[{{{Author}}}]] | {{{Publisher|{{{Agency|{{{Publication|Global News}}}}}}}}} }}
</div></div>
 
<!-- AUTOMATED CATEGORIZATION WITH SWITCH LOGIC -->
[[Category:events]]
[[Category:events]]
[[Category:{{#switch: {{{Type|Character News}}}
[[Category:{{#invoke:Timeline|newsType|{{{Type|}}}}}]]
| Global = Global News
{{#if:{{#invoke:Calendar|yearNum|{{{RealDate|}}}}}|[[Category:{{#invoke:Calendar|yearName|{{{RealDate|}}}}}]]}}
| Global News = Global News
| Domestic = Domestic News
| Domestic News = Domestic News
| Character = Character News
| Character News = Character News
| #default = Character News
}}]]
[[Category:Era Nova, Year {{#expr: 1 + floor( ({{#time:U|{{{RealDate}}}}} - {{#time:U|2026-07-28}}) / 1209600 )}}]]
{{#if: {{{Author|}}} | [[Category:{{{Author}}}]] | }}
{{#if: {{{Author|}}} | [[Category:{{{Author}}}]] | }}
</includeonly><noinclude>
</includeonly><noinclude>
{{#cargo_declare:_table=NewsPosts
|Page_Name=Page
|Title=String
|Type=String
|RealDate=Date
|Author=Page
|Publisher=String
|Year=String
|YearNum=Integer
|Period=String
|DayNum=Integer
}}
<div style="background-color: #ffe6e6; border: 2px solid #ff0000; padding: 15px; margin-bottom: 15px; border-radius: 5px;">
<div style="background-color: #ffe6e6; border: 2px solid #ff0000; padding: 15px; margin-bottom: 15px; border-radius: 5px;">
<span style="color: #cc0000; font-weight: bold; font-size: 110%;">CRITICAL DATE FORMAT WARNING</span><br>
<span style="color: #cc0000; font-weight: bold; font-size: 110%;">DATE FORMAT</span><br>
When using the <b>RealDate</b> parameter, you <b>MUST</b> write it in strict <b>YYYY-MM-DD</b> format (e.g., <tt>2026-09-15</tt>).<br>
When using the <b>RealDate</b> parameter, write it as <b>YYYY-MM-DD</b> (e.g., <tt>2026-09-15</tt>). Do not add a time of day.<br>
<u>DO NOT</u> use slashes or short-hand like <tt>15/09/26</tt>, or the wiki math engine will crash with an error!
If the date is wrong you will see a red error at the top of the post, and the post will <u>not</u> appear in the year timeline or the news feeds.
</div>
</div>
 
== Usage ==
== Usage ==
<pre>
<pre>
{{News Header
{{News Header
| Type       = Character News  <!-- Options: Character News, Global News, Domestic News -->
| Type     = Character News  <!-- Options: Character News, Global News, Domestic News -->
| Subheading = Basil's Story, Part I
| RealDate = 2026-09-15
| RealDate   = 2026-09-15
| Author   = Basil Blight    <!-- Use 'Author' for character news, or 'Publisher'/'Agency' for news outlets -->
| Author     = Basil Blight    <!-- Use 'Author' for character news, or 'Publisher'/'Agency' for news outlets -->
| Title    =                <!-- Optional: shown instead of the page's last segment -->
}}
}}
 
== The Story Begins ==
== The Story Begins ==
Write your raw text, add multiple images, use custom headers, or layout the page however you want below the header!
Write your raw text, add multiple images, use custom headers, or layout the page however you want below the header!
</pre>
</pre>
== What this does automatically ==
* Puts the post in the right news category and in <code>Category:Era Nova, Year N</code>.
* Adds the post to the <b>News Timeline</b> on the matching Era Nova year page.
* Adds it to the <b>Latest News</b> feed and to the author's <b>News</b> list.
<templatedata>
<templatedata>
{
{
Line 100: Line 97:
"required": true,
"required": true,
"default": "Character News",
"default": "Character News",
"suggestedvalues": [
"suggestedvalues": ["Character News", "Global News", "Domestic News"]
"Character News",
"Global News",
"Domestic News"
]
},
"Subheading": {
"label": "Subheading / Headline",
"description": "Optional title or headline displayed at the top of the header box.",
"type": "string",
"required": false,
"suggested": true
},
},
"RealDate": {
"RealDate": {
"label": "Real-world date (REQUIRED)",
"label": "Real-world date (REQUIRED)",
"description": "MUST BE YYYY-MM-DD. Do NOT use slashes!",
"description": "MUST BE YYYY-MM-DD, with no time of day. Do NOT use slashes!",
"type": "string",
"type": "string",
"required": true,
"required": true,
Line 123: Line 109:
"Author": {
"Author": {
"label": "Author (Character)",
"label": "Author (Character)",
"description": "Character author name (creates an author category and wiki link). Leave blank if using a news Publisher/Agency.",
"description": "Character author name (creates an author category, a wiki link and an entry in their News list). Leave blank if using a news Publisher/Agency.",
"type": "wiki-page-name",
"type": "wiki-page-name",
"required": false,
"required": false,
Line 130: Line 116:
"Publisher": {
"Publisher": {
"label": "Publisher / Agency",
"label": "Publisher / Agency",
"description": "Name of the news outlet (use this instead of Author for Global/Domestic news).",
"description": "Name of the news outlet or nation (use this instead of Author for Global/Domestic news). A [[link]] is allowed.",
"type": "string",
"type": "string",
"required": false,
"required": false,
"suggested": true
"suggested": true
},
"Title": {
"label": "Display title (optional)",
"description": "Only needed if the post should be shown under a different name than the last part of the page name.",
"type": "line",
"required": false
}
}
}
}

Latest revision as of 09:38, 24 October 2026

This template defines the table "NewsPosts". View table.

DATE FORMAT
When using the RealDate parameter, write it as YYYY-MM-DD (e.g., 2026-09-15). Do not add a time of day.
If the date is wrong you will see a red error at the top of the post, and the post will not appear in the year timeline or the news feeds.

Usage

{{News Header
| Type     = Character News  <!-- Options: Character News, Global News, Domestic News -->
| RealDate = 2026-09-15
| Author   = Basil Blight    <!-- Use 'Author' for character news, or 'Publisher'/'Agency' for news outlets -->
| Title    =                 <!-- Optional: shown instead of the page's last segment -->
}}
 
== The Story Begins ==
Write your raw text, add multiple images, use custom headers, or layout the page however you want below the header!

What this does automatically

  • Puts the post in the right news category and in Category:Era Nova, Year N.
  • Adds the post to the News Timeline on the matching Era Nova year page.
  • Adds it to the Latest News feed and to the author's News list.

Universal automated news and dispatch header for Project Aquila.

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
News Category TypeType

Defines the main category. Suggested values: Character News, Global News, Domestic News

Suggested values
Character News Global News Domestic News
Default
Character News
Stringrequired
Real-world date (REQUIRED)RealDate

MUST BE YYYY-MM-DD, with no time of day. Do NOT use slashes!

Example
2026-09-15
Stringrequired
Author (Character)Author

Character author name (creates an author category, a wiki link and an entry in their News list). Leave blank if using a news Publisher/Agency.

Page namesuggested
Publisher / AgencyPublisher

Name of the news outlet or nation (use this instead of Author for Global/Domestic news). A [[link]] is allowed.

Stringsuggested
Display title (optional)Title

Only needed if the post should be shown under a different name than the last part of the page name.

Lineoptional