Difference between revisions of "Template:Release"
(Changed syntax to allow a Release range) |
|||
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | {{# | + | {{#if: {{#isReleaseBetween:{{{1}}}|{{#svarget:anarelease}}|{{{2}}} }}|{{{3}}}}}<noinclude> |
===Syntax=== | ===Syntax=== | ||
<nowiki>{{Release|«firstRelease»|«lastRelease»|«content»}}</nowiki> | <nowiki>{{Release|«firstRelease»|«lastRelease»|«content»}}</nowiki> | ||
Line 17: | Line 17: | ||
=== Bar characters === | === Bar characters === | ||
Bar characters ('<code>|</code>') cannot appear within «content», except when they are inside links. This is primarily a problem in tables. Use the <nowiki>{{!}}</nowiki> template in place of bars. | Bar characters ('<code>|</code>') cannot appear within «content», except when they are inside links. This is primarily a problem in tables. Use the <nowiki>{{!}}</nowiki> template in place of bars. | ||
+ | |||
+ | === The assignment operator === | ||
+ | The <code>:=</code> character also seems to break it when used in «content». Use <nowiki>{{eq}}</nowiki> to print this sequence. | ||
=== Use the ReleaseBar === | === Use the ReleaseBar === | ||
Pages with content that vary by Release should place <code><nowiki>{{ReleaseBar}}</nowiki></code> at the top of the page. | Pages with content that vary by Release should place <code><nowiki>{{ReleaseBar}}</nowiki></code> at the top of the page. | ||
+ | |||
+ | === Math within content === | ||
+ | It seems that you cannot have a <code><math>...<math/></code> tag inside «content». When you do, it breaks. (If you find a way, document it here). | ||
+ | |||
+ | === Avoid all formatting issues === | ||
+ | You can avoid all these character problems by using the syntax: | ||
+ | :<code><nowiki>{{Release|1=5.0|2=6.2|3=«content»}}</nowiki></code> | ||
+ | When the parameters are numbered in this fashion, the unusual characters in «content» don't cause a problem. | ||
</noinclude> | </noinclude> |
Latest revision as of 23:06, 25 October 2024
Syntax
{{Release|«firstRelease»|«lastRelease»|«content»}}
«firstRelease» and «lastRelease» must be in the form «major».«minor», or can be omitted.
Examples
This shows only in 5.0 and after:
{{Release|5.0||use the hover icon.}}
This shows only in 4.6 and before:
{{Release||4.6|use the arrow toolbar button.}}
This shows in 5.0 but not 5.1:
{{Release|5.0|5.0|the icon looks like "?!"}}
Bar characters
Bar characters ('|
') cannot appear within «content», except when they are inside links. This is primarily a problem in tables. Use the {{!}} template in place of bars.
The assignment operator
The :=
character also seems to break it when used in «content». Use {{eq}} to print this sequence.
Use the ReleaseBar
Pages with content that vary by Release should place {{ReleaseBar}}
at the top of the page.
Math within content
It seems that you cannot have a <math>...<math/>
tag inside «content». When you do, it breaks. (If you find a way, document it here).
Avoid all formatting issues
You can avoid all these character problems by using the syntax:
{{Release|1=5.0|2=6.2|3=«content»}}
When the parameters are numbered in this fashion, the unusual characters in «content» don't cause a problem.