Template:News Header: Difference between revisions

From aquila
Jump to navigation Jump to search
No edit summary
mNo edit summary
 
(44 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>
<includeonly>__NOTITLE__
<div style="border: 1px solid #1a1a1a; background-color: #f8f9fa; padding: 16px 20px; margin-bottom: 1.5em; border-radius: 4px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); font-size: 105%;">{{#if: {{{Subheading|}}}|<div style="font-size: 140%; font-weight: bold; margin-bottom: 10px; border-bottom: 1px solid #c8ccd1; padding-bottom: 6px; color: #1a1a1a;">{{{Subheading}}}</div>}}<div style="font-size: 92%; color: #54595d; line-height: 1.6;"><b>In-universe date:</b> Era Nova, {{#switch: {{#expr: 1 + floor( (({{#time:U|{{{RealDate}}}}} - {{#time:U|2026-07-28}}) / 86400) mod 14 )}}
{{DISPLAYTITLE:{{#if:{{{Title|}}}|{{{Title}}}|{{#titleparts:{{FULLPAGENAME}}|1|-1}}}}}}
| 1 = January
{{#cargo_store: _table=NewsPosts
| 2 = January--February
|Page_Name={{FULLPAGENAME}}
| 3 = February--March
|Title={{#if:{{{Title|}}}|{{{Title}}}|{{#titleparts:{{FULLPAGENAME}}|1|-1}}}}
| 4 = March--April
|Type={{#invoke:Timeline|newsType|{{{Type|}}}}}
| 5 = April--May
|RealDate={{#invoke:Calendar|iso|{{{RealDate|}}}}}
| 6 = May--June
|Author={{{Author|}}}
| 7 = June--July
|Publisher={{{Publisher|{{{Agency|{{{Publication|}}}}}}}}}
| 8 = July--August
|Year={{#invoke:Calendar|yearName|{{{RealDate|}}}}}
| 9 = August--September
|YearNum={{#invoke:Calendar|yearNum|{{{RealDate|}}}}}
| 10 = September--October
|Period={{#invoke:Calendar|period|{{{RealDate|}}}}}
| 11 = October
|DayNum={{#invoke:Calendar|dayNum|{{{RealDate|}}}}}
| 12 = October--November
}}{{#invoke:Calendar|check|{{{RealDate|}}}}}<!--
| 13 = November--December
| 14 = Late December
--><div class="aquila-news-card">
| #default = January
}}, Year {{#expr: 1 + floor( ({{#time:U|{{{RealDate}}}}} - {{#time:U|2026-07-28}}) / 1209600 )}}<br>
<!-- Top Header / Article Title -->
<b>Real-world date:</b> {{{RealDate}}}<br>
<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>
<b>{{#if: {{{Author|}}} | Author | Publisher }}:</b> {{#if: {{{Author|}}} | [[{{{Author}}}]] | {{{Publisher|{{{Agency|{{{Publication|Global News}}}}}}}}} }}
</div></div>
<!-- News Metadata Stats Table (Full Width) -->
 
<div class="aquila-news-table-box">
<!-- AUTOMATED CATEGORIZATION WITH SWITCH LOGIC -->
[[Category:{{#switch: {{{Type|Character News}}}
<table style="width: 100%; border-collapse: collapse;">
| Global = Global News
<tr>
| Global News = Global News
  <td style="padding: 0.3em 0.5em; font-weight: bold; width: 25%; border-bottom: 1px solid #e2e8f0;">In-universe date</td>
| Domestic = Domestic News
  <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>
| Domestic News = Domestic News
</tr>
| Character = Character News
<tr>
| Character News = Character News
  <td style="padding: 0.3em 0.5em; font-weight: bold; border-bottom: 1px solid #e2e8f0;">Real-world date</td>
| #default = Character News
  <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>
[[Category:Era Nova, Year {{#expr: 1 + floor( ({{#time:U|{{{RealDate}}}}} - {{#time:U|2026-07-28}}) / 1209600 )}}]]
<tr>
  <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>
</tr>
<tr>
  <td style="padding: 0.3em 0.5em; font-weight: bold;">Category Type</td>
  <td style="padding: 0.3em 0.5em;">{{#invoke:Timeline|newsType|{{{Type|}}}}}</td>
</tr>
</table>
</div>
</div>
<!-- AUTOMATED CATEGORIZATION -->
[[Category:events]]
[[Category:{{#invoke:Timeline|newsType|{{{Type|}}}}}]]
{{#if:{{#invoke:Calendar|yearNum|{{{RealDate|}}}}}|[[Category:{{#invoke:Calendar|yearName|{{{RealDate|}}}}}]]}}
{{#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-08-26</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>26/08/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-07-29
| 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 62: 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 (e.g. 2026-07-29). 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,
"suggested": true
"suggested": true,
"example": "2026-09-15"
},
},
"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 91: 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