Jump to content

Template:Temporary wikitext/doc

From Wikipedia, the free encyclopedia

This substitution shows a wikitext in transclusion mode for a certain amount of time, then the transclusion permanently disappears leaving room to another custom wikitext (substituted). If the permanent wikitext is not given, the substitution simply disappears leaving no traces.

Usage

[edit]
Syntax
{{subst:temporarily|[temporary wikitext]|[permanent wikitext]|[time number]|[time unit]|[since=time]|[until=time]}}

If not specified, the time defaults to one week. And so, the following wikitext,

<!-- Once resolved, please remove this -->
{{subst:temporarily|{{WQA in progress}}|{{Stale}}}}

the first week will display

Work in progress; comments welcome

then will forever display

Stale

The change will happen in transclusion mode until someone edits the page after the first week; at that point the only code left will be:

<!-- Once resolved, please remove this -->
{{Stale}}

Imagining that the present time is 2024-10-09 15:57:43, the following examples behave as follows:

  • {{subst:temporarily|Foo|Bar|3|hours}} immediately after save
    ↳ Foo
    ↳ (saved wikitext) {{safesubst:Temporary wikitext|Foo|Bar|until=2025-10-09 18:57:43}}
  • {{subst:temporarily|Foo|Bar|3|hours}} saving again three hours after the first save
    ↳ Bar
    ↳ (saved wikitext) Bar
  • {{subst:temporarily|Foo|Bar|1|year|since=2024-10-09 18:57:43}}
    ↳ Foo
    ↳ (saved wikitext) {{safesubst:Temporary wikitext|Foo|Bar|until=2025-10-09 15:59:34}}
  • {{subst:temporarily|Foo|Bar|-1|hours|since=2030-01-01 00:00:00}}
    ↳ Foo
    ↳ (saved wikitext) {{safesubst:Temporary wikitext|Foo|Bar|until=2029-12-31 23:00:00}}
  • {{subst:temporarily|Foo|Bar|until=2022-02-17 13:21:44}}
    ↳ Bar
    ↳ (saved wikitext) Bar
  • {{subst:temporarily|Foo|Bar|until=1957-02-17 21:17:19 + 100 years - 2 weeks + 12 seconds}}
    ↳ Foo
    ↳ (saved wikitext) {{safesubst:Temporary wikitext|Foo|Bar|until=2057-02-03 21:17:31}}
  • {{subst:temporarily|Foo|Bar}}
    ↳ Foo
    ↳ (saved wikitext) {{safesubst:Temporary wikitext|Foo|Bar|until=2025-10-16 15:57:43}}
  • {{subst:temporarily|Foo}}
    ↳ Foo
    ↳ (saved wikitext) {{safesubst:Temporary wikitext|Foo|until=2025-10-16 15:57:43}}

The |since= and |until= parameters accept the same syntax that the {{#time}} parser function understands.

The special parameters |pre-unsubst= and |post-unsubst= can be used to set two custom texts to prepend and append in transclusion mode when the expiration time has passed but no one has edited the page again yet. They can be used to add null-edit links or tracing categories. If the page is edited after the expiration time they will be lost. For instance (one week after being saved):

  • {{safesubst:Temporary wikitext|Foo|Bar|post-unsubst=<sup>&#91;[[Special:EditPage/{{#invoke:params|self}}|null edit required]]&#93;</sup>}}
    ↳ Bar[null edit required]

Parameter usage

[edit]

This substitution shows a wikitext for a certain amount of time, then the transclusion permanently disappears leaving room to another custom wikitext.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Temporary wikitext1

Wikitext to show before the expiration time

Example
Foo
Contentoptional
Permanent wikitext2

Wikitext to show after the expiration time

Example
Bar
Contentoptional
Time number3

The numeric part of the time

Default
1
Example
17
Numberoptional
Time unit4

The unit part of the time – possible units are: ‘second’, ‘seconds’, ‘minute’, ‘minutes’, ‘hour’, ‘hours’, ‘week’, ‘weeks’, ‘day’, ‘days’, ‘month’, ‘months’, ‘year’, ‘years’

Default
week
Example
minute
Stringoptional
Sincesince

To which time the ‘|1=’ and ‘|2=’ parameters must be added (written according to the same syntax that the {{#time}} parser function understands) – if the ‘|1=’ parameter is missing and the ‘|until=’ parameter is provided this parameter is ignored

Default
now
Example
2024-10-09 18:57:43
Stringoptional
Untiluntil

Up to which time the ‘|1=’ parameter must be shown (written according to the same syntax that the {{#time}} parser function understands) – if the ‘|3=’ parameter is given this parameter is ignored

Default
now + 1 week
Example
2022-02-17 13:21:44
Stringoptional
Prepend unsubstitutedpre-unsubst

Text to prepend in transclusion mode to the permanent wikitext until someone edits the page.

Example
[[Category:Pages requiring a null edit]]
Stringoptional
Append unsubstitutedpost-unsubst

Text to append in transclusion mode to the permanent wikitext until someone edits the page.

Example
<sup>&#91;[[Special:EditPage/{{#invoke:params|self}}|null edit required]]&#93;</sup>
Stringoptional

Helper subtemplates

[edit]

Synonyms

[edit]

See also

[edit]