Difference between revisions of "Version/doc"
From Joomla! Documentation
< Template:Version
(notice) |
m (first save) |
||
Line 1: | Line 1: | ||
{{documentation subpage}} | {{documentation subpage}} | ||
{{notice|Please don't use this template until this notice is removed, it is under development. ---Thank you}} | {{notice|Please don't use this template until this notice is removed, it is under development. ---Thank you}} | ||
+ | |||
+ | ==Use== | ||
+ | This template will place a bar across the top of a wiki page noting the version and alternate versions with a link. See [[Template:Version/doc#Parameters|Parameters]] for all available parameters. This template also uses the [[mw:Extension:Arrays|Arrays Extension]], which allows multiple variables separated by commas. | ||
+ | ==Examples== | ||
+ | Use the following code as the very top and first part of an article to place a version notice. | ||
+ | <pre>{{version|2.5}}</pre> | ||
+ | {{version|2.5}} | ||
+ | <pre>{{version|1.6,1.7,2.5}}</pre> | ||
+ | {{version|1.6,1.7,2.5}} | ||
+ | <pre>{{version|platform=11.1,11.2}}</pre> | ||
+ | {{version|platform=11.1,11.2}} | ||
+ | <pre>{{version|1.6,1.7,2.5|platform=11.1,11.2}}</pre> | ||
+ | {{version|1.6,1.7,2.5|platform=11.1,11.2}} | ||
+ | <pre>{{version|1.6,1.7,2.5|alt=1.5|altlink=:Category:Joomla! Version 1.5|alttitle=Joomla! 1.5 Category}}</pre> | ||
+ | {{version|1.6,1.7,2.5|alt=1.5|altlink=:Category:Joomla! 1.5|alttitle=Joomla! 1.5 Category}} | ||
+ | |||
+ | ==Parameters== | ||
+ | |||
+ | ==Usage Issues== | ||
+ | * 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== | ||
+ | *This is the wiki markup used; *NOTE* - comments, line breaks and whitespace must be removed. | ||
+ | <pre> | ||
+ | <!--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 is 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> | ||
+ | </pre> |
Revision as of 17:26, 9 September 2012
This is a documentation subpage for Template:Version.
It contains usage information, categories and other content that is not part of the original template page.
To view the template page itself, see Template:Version.
It contains usage information, categories and other content that is not part of the original template page.
To view the template page itself, see Template:Version.
Please don't use this template until this notice is removed, it is under development. ---Thank you
Use[edit]
This template will place a bar across the top of a wiki page noting the version and alternate versions with a link. See Parameters for all available parameters. This template also uses the Arrays Extension, which allows multiple variables separated by commas.
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]
Usage Issues[edit]
- 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 is 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>