Template:Unlock: Difference between revisions

From railML 2 Wiki
Jump to navigation Jump to search
[checked revision][checked revision]
(Created page with "<includeonly>{{#ifeq:{{{1}}}|{{current}}||{{{2}}}}}</includeonly><noinclude> ==Usage== This template hides content under the given version. If the current version, as visible...")
 
 
(16 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>{{#ifeq:{{{1}}}|{{current}}||{{{2}}}}}</includeonly><noinclude>
<includeonly>{{#ifeq:{{{1}}}|{{current|{{{wiki}}}}}|{{#if:{{#var:show}}|{{{2}}}|{{{3|}}}}}|{{{2}}}}}</includeonly><noinclude>
==Usage==
==Usage==
This template hides content under the given version. If the current version, as visible from [[template:current]], becomes different from argument 1, then the text in argument 2 becomes visible. The template is intended to prepare content for upcoming versions.
This template hides content under the given version. If the current version, as visible from [[template:current]], becomes different from argument 1, then the text in argument 2 becomes visible. If argument 3 is given, it will be shown under the given version, but hidden otherwise. The template is intended to prepare content for upcoming versions.
 
Alternatively, use [[Template:Future]] to mark visible content as refering to upcoming versions.
 
To switch off Template:Unlock on a particular page as to get a preview, add [[Template:Show|<nowiki>{{show}}</nowiki>]] at the top of the page. You might prefer to place the preview in your userspace e.g. with  [[Template:Frame]].


Alternatively, use [[template:future]] to mark visible content as refering to upcoming versions.
===Arguments===
===Arguments===
'''1:''' a version. If it is identical to <nowiki>{{current}}</nowiki> (currently {{current}}), then the text in '''2''' is hidden
*Obligatory:
'''2:''' a text
**'''1:''' a version. If it is identical to <nowiki>{{current}}</nowiki> (currently {{current}}), then the text in '''2''' is hidden
**'''2:''' a text
*Optional:
**'''3:''' an alternative text; default: empty. This text is visible if 1=<nowiki>{{current}}</nowiki> but hidden otherwise.
 
===dependencies===
===dependencies===
The template depends on [[template:current]].
The template depends on [[template:current]].
==Examples==
==Examples==
<pre>{{unlock|2.3|This text is hidden under version 2.3}}</pre>
<pre>{{unlock|2.3|This text is hidden under version 2.3}}</pre>
Line 18: Line 26:


{{unlock|2.2|This text is visible since version 2.3}}
{{unlock|2.2|This text is visible since version 2.3}}
<pre>{{unlock|2.4|This text is hidden under version 2.4|This text is visibvle under version 2.5|wiki=2}}</pre>
delivers
{{unlock|2.4|This text is hidden under version 2.4|This text is visible under version 2.5|wiki=2}}
<pre>{{unlock|3.1|This text is hidden under version 3.1|This text is visibvle under version 3.2|wiki=3}}</pre>
delivers
{{unlock|3.1|This text is hidden under version 3.1|This text is visible under version 3.2|wiki=3}}
{{interwiki}}
</noinclude>
</noinclude>

Latest revision as of 13:38, 20 August 2021

Usage

This template hides content under the given version. If the current version, as visible from template:current, becomes different from argument 1, then the text in argument 2 becomes visible. If argument 3 is given, it will be shown under the given version, but hidden otherwise. The template is intended to prepare content for upcoming versions.

Alternatively, use Template:Future to mark visible content as refering to upcoming versions.

To switch off Template:Unlock on a particular page as to get a preview, add {{show}} at the top of the page. You might prefer to place the preview in your userspace e.g. with Template:Frame.

Arguments

  • Obligatory:
    • 1: a version. If it is identical to {{current}} (currently 2.5), then the text in 2 is hidden
    • 2: a text
  • Optional:
    • 3: an alternative text; default: empty. This text is visible if 1={{current}} but hidden otherwise.

dependencies

The template depends on template:current.

Examples

{{unlock|2.3|This text is hidden under version 2.3}}

delivers nothing under version 2.3. Under version 2.4 it will become visible

This text is hidden under version 2.3

{{unlock|2.2|This text is visible since version 2.3}}

delivers

This text is visible since version 2.3

{{unlock|2.4|This text is hidden under version 2.4|This text is visibvle under version 2.5|wiki=2}}

delivers

This text is hidden under version 2.4

{{unlock|3.1|This text is hidden under version 3.1|This text is visibvle under version 3.2|wiki=3}}

delivers

This text is hidden under version 3.1