Template

Difference between revisions of "Version"

From Joomla! Documentation

m (alternate version and alternate link title, must have a link to show alternate version)
m (bottom border color)
(26 intermediate revisions by the same user not shown)
Line 1: Line 1:
<div style="position:relative; left:0px; top:-10px; width:100%; margin-bottom:-20px;" class="metadata" id="version">
+
<includeonly><div style="position:relative; left:0px; top:0px; width:100%; margin-bottom:0px;" class="metadata" id="version">
<div style="width:auto; border:1px solid #84ABD4; padding:1px 3px 1px 3px; background-color:#B7E2FB; text-align:center; font-size:1.0em; -moz-border-radius:5px; border-radius:5px;">{{#arraydefine:Vicon|{{{1|}}}}}{{#if:{{{1|}}}|This article is for Joomla! CMS Version(s) {{#arrayprint:Vicon|&nbsp;|@@@@|{{JVer|@@@@}} }}{{#if:{{{platform|}}}|{{#arraydefine:Picon|{{{platform|}}}}}|}}|{{#if:{{{platform|}}}|{{#arraydefine:Picon|{{{platform|}}}}}This article is for Joomla! Platform Version(s) {{#arrayprint:Picon|&nbsp;|@@@@|{{JVer|@@@@}} }}{{#arrayreset:Picon}}|'''TEMPLATE ERROR - Version(s) Needed. Please Check Usage.'''}}}}{{#if:{{#arraysize:Picon}}|&nbsp;and Joomla! Platform Version(s) {{#arrayprint:Picon|&nbsp;|@@@@|{{JVer|@@@@}}}}{{#arrayreset:Picon}}|}}{{#if:{{{altlink|}}}|{{#arraydefine:Aicon|{{{alt|}}}}} - For version(s){{#arrayprint:Aicon|&nbsp;|@@@@|{{JVer|@@@@}} }} see [[{{{altlink|}}}]]{{#arrayreset:Aicon}}|}}</div></div>
+
<div style="width:auto; border-bottom:1px solid #aaa; padding:0; background-color:rgba(183,226,251,.5); text-align:center; font-size:.8em; -moz-border-radius:3px; border-radius:3px; margin-bottom:1em; line-height:1em;">{{#arraydefine:Vicon|{{{1|}}}}}{{#if:{{{1|}}}|{{#if:{{{altlink|}}}|[[Image:Stop_hand_nuvola.svg.png‎|20px]]&nbsp;|}}This article is for Joomla! CMS Version(s) {{#arrayprint:Vicon|&nbsp;|@@@@|{{JVer|@@@@}} }}{{#if:{{{platform|}}}|{{#arraydefine:Picon|{{{platform|}}}}}|}}|{{#if:{{{platform|}}}|{{#arraydefine:Picon|{{{platform|}}}}}{{#if:{{{altlink|}}}|[[Image:Stop_hand_nuvola.svg.png‎|20px]]&nbsp;|}}This article is for Joomla! Platform Version(s) {{#arrayprint:Picon|&nbsp;|@@@@|{{JVer|@@@@}} }}{{#arrayreset:Picon}}|'''TEMPLATE ERROR - Version(s) Needed. Please Check Usage.'''}}}}{{#if:{{#arraysize:Picon}}|&nbsp;and Joomla! Platform Version(s) {{#arrayprint:Picon|&nbsp;|@@@@|{{JVer|@@@@}}}}{{#arrayreset:Picon}}|}}{{#if:{{{altlink|}}}|{{#arraydefine:Aicon|{{{alt|}}}}}&nbsp;&nbsp;'''&rarr;''' For a&nbsp;{{#arrayprint:Aicon|&nbsp;|@@@@|{{JVer|@@@@}} }} article, see:-&nbsp;'''[[{{{altlink|}}}|{{{alttitle|{{{altlink}}}}}}]]'''{{#arrayreset:Aicon}}|}}</div></div></includeonly>
 
<noinclude>
 
<noinclude>
 
{{documentation}}
 
{{documentation}}
 +
[[Category:Marker templates]]
 
</noinclude>
 
</noinclude>

Revision as of 22:39, 24 February 2014


[view] [edit] [history]

Template-info.pngTemplate documentation

Usage[edit]

This template will place a bar across the top of a wiki page noting the version and alternate versions with a link specifically for Articles. Other Version Templates:

See Parameters for all available parameters. This template also uses the Arrays Extension, which allows multiple variables separated by commas. If you are having problems or you notice any bugs, please post a notice on the talk page of this template, or the author's talk page.

Examples[edit]

Use the following code as the very top and first part of an article to place a version notice.

{{version|2.5}}
{{version|1.6,1.7,2.5}}
{{version|platform=11.1,11.2}}
{{version|1.6,1.7,2.5|platform=11.1,11.2}}
{{version|1.6,1.7,2.5|alt=1.5|altlink=:Category:Joomla! Version 1.5|alttitle=Joomla! 1.5 Category}}


Parameters[edit]

Parameter Parameter description Example req./opt.
{{{1}}} Joomla! CMS Version(s) 2.5 or 1.6,1.7,2.5 (an array) required or must use platform=
platform= Joomla! Platform Version(s) platform=11.1 or platform=11.2,11.3 required or must use {{{1}}}
alt= Alternate Version(s), can be CMS or Platform alt=1.5, alt=1.7,2.5 (an array) or alt=11.2,11.3 optional (must also use altlink)
altlink= Alternate Version's Link to Article altlink=Joomla! 1.5 optional (must also use alt)
alttitle= Alternate Version's Link to Article's Title alttitle=a must read! optional


Usage Issues[edit]

  • When use the |alt=(version#), you must use |altlink=(a link). The template checks for another page link, before the alternate version icons and the notice is included.
  • Links to Categories, you must use the : (colon) symbol to create a link to a Category page. The link will actually show as :Category:This article with the :. Recommend use of the alttitle= variable, alttitle=Category;This article will mask the actual link.

Reference[edit]

  • This is the wiki markup used; *NOTE* - comments, line breaks and whitespace must be removed.
   <!--Main container-->
<div style="position:relative; left:0px; top:-10px; width:100%; margin-bottom:-20px;" class="metadata" id="version">
   <!--Inside containter which holds the actual content of the template-->
<div style="width:auto; border:1px solid #84ABD4; padding:1px 3px 1px 3px; background-color:#B7E2FB;
 text-align:center; font-size:1.0em; -moz-border-radius:5px; border-radius:5px; margin-bottom:20px;"> 
   
   <!--Create the array for the JVer icon template calls from variable(anonymous 1),
       it is ok if it doesn't have the anonymous variable, platform= is the backup check,
       but one of them must contain a value-->
{{#arraydefine:Vicon|{{{1|}}}}}
   <!-- If variable(anonymous 1) contains values, they are the CMS version numbers-->
{{#if:{{{1|}}}|
   <!-- Variable 1 has value, process this--><!-- Start of 1st IF true-->
     <!-- First, check for altlink(Alternate Link) if yes, print stop_hand icon, no altlink then skip -->
{{#if:{{{altlink|}}}|[[Image:Stop_hand_nuvola.svg.png‎|26px]] |}}
   <!-- Start printing the notice -->
This article is for Joomla! CMS Version(s) 
   <!-- Call the array and print the JVer icons, CMS Versions are default, Platform is backup-->
{{#arrayprint:Vicon| |@@@@|{{JVer|@@@@}} }}
   <!-- Call the Platform versions if needed-->
{{#if:{{{platform|}}}|
   <!-- Define the Array for Platform for use in the Extras section-->
{{#arraydefine:Picon|{{{platform|}}}}}|}}| <!-- End of first IF - proceeds to Extras section -->

   <!-- If the anonymous(Variable 1) was missing... Print the Platform message instead (the 2nd IF)-->
{{#if:{{{platform|}}}|
   <!-- Create the array for this alternative Print-->
{{#arraydefine:Picon|{{{platform|}}}}}
   <!-- Checking for altlink, print the icon stop_hand-->
{{#if:{{{altlink|}}}|[[Image:Stop_hand_nuvola.svg.png‎|26px]] |}}
   <!-- Start printing the Platform notice -->
This article is for Joomla! Platform Version(s) 
   <!-- Print the Array for icons, then reset it-->
{{#arrayprint:Picon| |@@@@|{{JVer|@@@@}} }}{{#arrayreset:Picon}}| <!--End of 2nd IF-->

   <!-- Something is missing, IF 1 fail, IF 2 fail, means(anonymous 1 or platform=)
        no value, show an error-->
'''TEMPLATE ERROR - Version(s) Needed. Please Check Usage.'''}}}}

   <!--Now the Extras, print a CMS and Joomla Platforms message if relevant,
      check for the Alternate Versions and link to the alternate title-->

   <!-- Check if there is an Array called Picon with a value-->
{{#if:{{#arraysize:Picon}}|
   <!-- Yes, now print it and the Icons otherwise, skip it completely-->
 and Joomla! Platform Version(s) {{#arrayprint:Picon| |@@@@|{{JVer|@@@@}}}}{{#arrayreset:Picon}}|}}
   <!-- Check for an altlink value-->
{{#if:{{{altlink|}}}|
   <!-- Define the alt version Array, note, altlink must have a value or Array creation is skipped-->
{{#arraydefine:Aicon|{{{alt|}}}}}
   <!-- Put it all together and print it-->
  '''→''' For a {{#arrayprint:Aicon| |@@@@|{{JVer|@@@@}} }} article, see:- 
   <!-- Create the link from altlink and alttitle-->
'''[[{{{altlink|}}}|{{{alttitle|{{{altlink}}}}}}]]'''
   <!-- Clear the Array-->
{{#arrayreset:Aicon}}|}}
   <!-- Close the div containers-->
</div></div>