Anonymous edits have been disabled on the wiki. If you want to contribute please login or create an account.


Warning for game developers: PCGamingWiki staff members will only ever reach out to you using the official press@pcgamingwiki.com mail address.
Be aware of scammers claiming to be representatives or affiliates of PCGamingWiki who promise a PCGW page for a game key.

Difference between revisions of "Template:DisplayTemporarily"

From PCGamingWiki, the wiki about fixing PC games
m (made away from FROM as its unacceptable)
m (|Data=Wikitext)
 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<includeonly><!--
 
<includeonly><!--
-->{{#if: | {{{from|}}} | {{#vardefine:from | {{{from|}}} }} | {{#vardefine:from | January 1, 2019 }} }}<!--
+
-->{{#vardefine:from | {{{from|January 1, 2019}}} }}<!-- Human-readable date stored in the Cargo table
-->{{#if: | {{{to|}}}   | {{#vardefine:to  | {{{to|}}}   }} | {{#vardefine:to  | January 1, 2030 }} }}<!--
+
-->{{#vardefine:fromUnix | {{#time: xNU | {{#var:from}} }} }}<!-- Unix time converted
-->{{#if: | {{{data|}}} | {{#vardefine:data | {{{data|}}} }} | {{#vardefine:data | {{{1|}}} }}
+
-->{{#vardefine:to  | {{{to|January 1, 2030}}}}<!-- Human-readable date stored in the Cargo table
 +
-->{{#vardefine:toUnix | {{#time: xNU | {{#var:to}} }} }}<!-- Unix time converted
 +
-->{{#vardefine:data | {{{data|{{{1|}}}}}} }}<!-- Actual data displayed
 +
-->{{#vardefine:nowUnix | {{#time: xNU | now }} }}<!-- Unix time converted
 +
-->{{#ifexpr: {{#var:fromUnix}} <= {{#var:nowUnix}} and {{#var:nowUnix}} <= {{#var:toUnix}} | {{#var:data}} }}<!--
  
{{#var:from}}
+
--- Cargo Store statement ---
{{#var:to}}
+
-->{{#cargo_store:
{{#var:data}}
+
_table=TempDisplay
 
 
<!-- Cargo Store statement -->
 
{{#cargo_store:
 
_table=DisplayTemporarily
 
 
|From_date={{#var:from}}
 
|From_date={{#var:from}}
 
|To_date={{#var:to}}
 
|To_date={{#var:to}}
 
|Data={{#var:data}}
 
|Data={{#var:data}}
 
}}</includeonly><!--
 
}}</includeonly><!--
--><noinclude>
+
--><noinclude><!--
<!-- Cargo Declare statement -->
+
 
{{#cargo_declare:
+
--- Cargo Declare statement ---
_table=DisplayTemporarily
+
-->{{#cargo_declare:
 +
_table=TempDisplay
 
|From_date=Date
 
|From_date=Date
 
|To_date=Date
 
|To_date=Date
|Data=String
+
|Data=Wikitext
 
}}{{Documentation}}</noinclude>
 
}}{{Documentation}}</noinclude>

Latest revision as of 17:02, 3 October 2023

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

Documentation for the above template (sometimes hidden from view).

Description

Template used to allow a temporary message or information to be displayed on a page, and tracked (for later removal) in the relevant Cargo table.

This allows for temporary exposure of information such as, e.g.:

  • Fixboxes/issue sections only relevant for a while after the release of a patch.
  • Key points or similar notes about temporary measurements needed, or future events (e.g. service shutdowns) of a game.

Note that the data will also be hidden when previewing the page if the current date is outside of the specified range!


Syntax

{{DisplayTemporarily|from= December 1, 2019 (optional) |to= January 1, 2020 (optional) |data= {{ii}} Online services will be unavailable during the month of December. }}
  • from start date of when to display the information. Defaults to January 1, 2019 if omitted (meaning there is no start date).
  • to end date of when the information should be hidden again. Defaults to January 1, 2030 if omitted (meaning there pretty much is no end date).
  • data is the data that will be presented between the specified dates.
    • data= can be omitted, in which case the "first unnamed parameter" of the call will be used instead.

Example

{{DisplayTemporarily|to=2023-10-16|data=Included with {{Store feature|Xbox Game Pass}}.}}

This will show a normal notice up until October 16, 2023 at which point the note will disappear from view the next time the article is purged.