Template:Out of date: Difference between revisions

From bg3.wiki
Jump to navigation Jump to search
No edit summary
(Added aliases)
 
(6 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{ambox|type=content|image=[[File:Refreshed_Condition_Icon.webp|35px|link=]]|text={{#if: {{{1|}}} | This article was marked as out of date {{#ifeq: {{#expr: floor({{#expr: {{#time: xNU | {{currentdate}}}} - {{#time: xNU | {{{1|}}} }}}} / 86400)}} | 0 | today, | {{#expr: floor({{#expr: {{#time: xNU | {{currentdate}}}} - {{#time: xNU | {{{1|}}} }}}} / 86400)}} days ago,}} and may need to be updated. {{{reason|No reason for adding this template was given.}}} Remove this notice when the article is up to date.}} {{#ifexpr: {{#time: xNU | {{lastupdatedate}}}} > {{#time: xNU | {{REVISIONTIMESTAMP}}}} | This article was last edited {{#expr: floor({{#expr: {{#time: xNU | {{lastupdatedate}}}} - {{#time: xNU | {{REVISIONTIMESTAMP}}}}}} / 86400)}} days before the[[Patch notes|most recent update]] to the game and may not be up to date. Remove this notice when the article is up to date.}}}}<includeonly>{{main namespace only|[[Category:Articles in need of updating]]}}</includeonly><noinclude>{{documentation|content=Displays a notice if the page hasn't been updated since the latest game patch.
<includeonly>{{#if: {{{date|{{{1|}}}}}}
| <!-- Date provided -->
{{#lvardef: timestamp_diff |
  {{#expr:  
    {{#time: xNU | {{currentdate}}}} - {{#time: xNU | {{{date|{{{1|}}}}}} }}
  }}
}}
{{#lvardef: days_out_of_date |
  {{#expr:  
    floor({{#lvar: timestamp_diff }} / 86400)
  }}
}}
{{#lvardef: last_update |
  {{#ifeq: {{#lvar: days_out_of_date}}
  | 0
  | today
  | {{#lvar: days_out_of_date}} days ago
  }}
}}
{{ambox
| type = content
| image = [[File:Refreshed_Condition_Icon.webp|35px|link=]]
| text = This article was marked as out of date {{#lvar: last_update}}, and may need to be updated. {{{reason|{{{2|No reason for adding this template was given.}}}}}} Remove this notice when the article is up to date.
}}
| <!-- No date provided -->
{{ambox
| type = content
| image = [[File:Refreshed_Condition_Icon.webp|35px|link=]]
| text = This article was marked as out of date and may need to be updated. {{{reason|No reason for adding this template was given.}}} Remove this notice when the article is up to date.
}}
}}{{main namespace only|[[Category:Articles in need of updating]]}}</includeonly><noinclude>{{documentation|content=
{{Shortcut|Needs update|Lastupdated}}
Displays a notice if a page is out of date and needs to be updated.


<pre> {{lastupdated}} </pre>
This template has a corresponding maintenance category: [[:Category:Articles in need of updating]].
Result:
== Examples ==
{{Template demo
| style = list
| caption 1 = No date supplied.
| <nowiki>{{Out of date}} </nowiki>
| caption 2 = Date manually specified.
| <nowiki>{{Out of date|2024-12-04}} </nowiki>
| caption 3 = Date specified using automatic substitution. This is the preferred method.
| <nowiki>{{Out of date|{{safesubst:currentdate}}}} </nowiki>
| caption 4 = Reason specified
| <nowiki>{{Out of date|2024-12-04|This spell was changed in Patch 8 and the article needs to be updated.}} </nowiki>
| caption 5 = Block format
| <nowiki>
{{Out of date
| date = 2024-12-04
| reason = This spell was changed in Patch 8 and the article needs to be updated.
}}
</nowiki>
}}


{{lastupdated}}
Can also be used to mark an entire article as out of date by specifying a date in the first parameter.
<pre> {{lastupdated|{{subst:currentdate}}}}</pre>
Result:
{{lastupdated|{{currentdate}}}}
A reason can be given with the reason parameter, provided that a date is entered
<pre> {{lastupdated|{{subst:currentdate}}|reason=This is an example.}}</pre>
Result:
{{lastupdated|00:23, 2024-01-4|reason=This is an example.}}
[[Category:Templates]][[Category:Messave box templates]]
== Template data ==
== Template data ==
<templatedata>
<templatedata>
{
{
    "description": "Mark a page as out-of-date and requiring updates.",
"params": {
"params": {
"1": {
"1": {
"autovalue": "{{subst:CURRENTDATE}}",
            "aliases": ["date"],
            "description": "The date this notice was added.",
            "type": "string",
"autovalue": "{{safesubst:CURRENTDATE}}",
"suggested": true
"suggested": true
},
},
"reason": {}
"2": {
            "aliases": ["reason"],
            "description": "The reason this notice was added",
            "type": "string",
            "suggested": true
        }
}
}
}
}
</templatedata>}}
</templatedata>}}
[[Category:Templates]]
[[Category:Message box templates]]
</noinclude>
</noinclude>

Latest revision as of 03:49, 14 December 2024

Template documentation
Shortcuts

Displays a notice if a page is out of date and needs to be updated.

This template has a corresponding maintenance category: Category:Articles in need of updating.

Examples

No date supplied.

Markup
{{Out of date}} 
Renders as

Date manually specified.

Markup
{{Out of date|2024-12-04}} 
Renders as

Date specified using automatic substitution. This is the preferred method.

Markup
{{Out of date|{{safesubst:currentdate}}}} 
Renders as

Reason specified

Markup
{{Out of date|2024-12-04|This spell was changed in Patch 8 and the article needs to be updated.}} 
Renders as

Block format

Markup

{{Out of date | date = 2024-12-04 | reason = This spell was changed in Patch 8 and the article needs to be updated. }}

Renders as

Template data

Mark a page as out-of-date and requiring updates.

Template parameters

ParameterDescriptionTypeStatus
11 date

The date this notice was added.

Auto value
{{safesubst:CURRENTDATE}}
Stringsuggested
22 reason

The reason this notice was added

Stringsuggested