Template:Temporary wikitext/doc
| This is a documentation subpage for Template:Temporary wikitext. It may contain usage information, categories and other content that is not part of the original template page. |
This template should always be substituted – use {{subst:Temporary wikitext}}. |
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
then will forever display
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}}
- ↳ (saved wikitext)
- ↳ Foo
{{subst:temporarily|Foo|Bar|3|hours}}saving again three hours after the first save- ↳ Bar
- ↳ (saved wikitext)
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}}
- ↳ (saved wikitext)
- ↳ Foo
{{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}}
- ↳ (saved wikitext)
- ↳ Foo
{{subst:temporarily|Foo|Bar|until=2022-02-17 13:21:44}}- ↳ Bar
- ↳ (saved wikitext)
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}}
- ↳ (saved wikitext)
- ↳ Foo
{{subst:temporarily|Foo|Bar}}- ↳ Foo
- ↳ (saved wikitext)
{{safesubst:Temporary wikitext|Foo|Bar|until=2025-10-16 15:57:43}}
- ↳ (saved wikitext)
- ↳ Foo
{{subst:temporarily|Foo}}- ↳ Foo
- ↳ (saved wikitext)
{{safesubst:Temporary wikitext|Foo|until=2025-10-16 15:57:43}}
- ↳ (saved wikitext)
- ↳ Foo
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>[[[Special:EditPage/{{#invoke:params|self}}|null edit required]]]</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.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Temporary wikitext | 1 | Wikitext to show before the expiration time
| Content | optional |
| Permanent wikitext | 2 | Wikitext to show after the expiration time
| Content | optional |
| Time number | 3 | The numeric part of the time
| Number | optional |
| Time unit | 4 | The unit part of the time – possible units are: ‘second’, ‘seconds’, ‘minute’, ‘minutes’, ‘hour’, ‘hours’, ‘week’, ‘weeks’, ‘day’, ‘days’, ‘month’, ‘months’, ‘year’, ‘years’
| String | optional |
| Since | since | 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
| String | optional |
| Until | until | 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
| String | optional |
| Prepend unsubstituted | pre-unsubst | Text to prepend in transclusion mode to the permanent wikitext until someone edits the page.
| String | optional |
| Append unsubstituted | post-unsubst | Text to append in transclusion mode to the permanent wikitext until someone edits the page.
| String | optional |
Helper subtemplates
[edit]- {{../check}}
Synonyms
[edit]See also
[edit]