Template:Test2: Difference between revisions

From A KoL Wiki
imported>Starwed
No edit summary
imported>Foggy
No edit summary
 
(19 intermediate revisions by 5 users not shown)
Line 1: Line 1:
<includeonly>[[Image:{{{image}}}|link={{{link}}}]]</includeonly><noinclude>
<includeonly><phptag>
$first_letter_vowel = preg_match('/^[aeiou]/i',$argv[1]);
$first_letter_cap = (preg_match('/^[A-Z]/',$argv[1]));
if (isset($argv[2])) {
  if ($argv[2] == 'y') {
      $first_letter_cap = FALSE;
  }
}
if ($first_letter_vowel) {
  if ($first_letter_cap) {
    echo "An ";
  } else {
  echo "an ";
  }
} else {
  if ($first_letter_cap) {
    echo "A ";
  } else {
  echo "a ";
  }
}
echo $argv[1];
</phptag></includeonly><noinclude>
{{Code2}}
{{Code2}}
==Usage==
Example: "{{Test2|image=oven.gif|link=Cooking}}"
<center>Centered example: "{{Test2|image=oven.gif|link=Cooking}}"</center>


==Instructions==
==Instructions==
Similar to the [[Sandbox]], this page is here for you to play around with templates. Do what you like with it, but please leave this explanatory section.
Similar to the [[TheKolWiki:Sandbox|Sandbox]], this page is here for you to play around with templates. Do what you like with it, but please leave this explanatory section.


Insert your desired template contents above between the "includeonly" tags, and alter the instance below to include any parameters you may need.
Insert your desired template contents above between the "includeonly" tags, and alter the instance below to include any parameters you may need. You may need to [http://kol.coldfront.net/thekolwiki/index.php?title={{FULLPAGENAME}}&action=purge purge this page] to see the effects of changes to this template's code. The same also holds for any other template. Otherwise, you may have to wait several minutes before the wiki starts using the new code.


Always give a template a category, even if it is [[:Category:Test Templates]]. For help on how a template works, read some [[MetaWikipedia:Help:Template|documentation]].
Always give a template a category, even if it is [[:Category:Test Templates]]. For help on how a template works, read some [[MetaWikipedia:Help:Template|documentation]].


Current Test: Fixing click
Current Test: leading article
==Template Effects==
*{{Test2|igloo}}
*{{Test2|Igloo}}
*{{Test2|tent}}
*{{Test2|Tent}}
*{{Test2|Igloo|y}}
*{{Test2|Tent|y}}
 


==Template Effects==
{| border=1px cellpadding=5 cellspacing=0
{{Test2|full=2|adv=4}}{{Test2|full=3|adv=7}}{{#if:{{{1|}}}|{{Test2|full=1}}}}{{#if:{{{2|}}}|{{Test2|full=2}}}}{{Test2|full=6|adv=20}}{{#if:{{{3|}}}|{{Test2|full=8}}}}
|}
[[Category:Test Templates]]</noinclude>
[[Category:Test Templates]]</noinclude>

Latest revision as of 14:08, 9 June 2015

{{Test2}}
<phptag>

$first_letter_vowel = preg_match('/^[aeiou]/i',$argv[1]); $first_letter_cap = (preg_match('/^[A-Z]/',$argv[1])); if (isset($argv[2])) { if ($argv[2] == 'y') { $first_letter_cap = FALSE; } } if ($first_letter_vowel) { if ($first_letter_cap) { echo "An "; } else { echo "an "; } } else { if ($first_letter_cap) { echo "A "; } else { echo "a "; } } echo $argv[1];

</phptag>

Instructions

Similar to the Sandbox, this page is here for you to play around with templates. Do what you like with it, but please leave this explanatory section.

Insert your desired template contents above between the "includeonly" tags, and alter the instance below to include any parameters you may need. You may need to purge this page to see the effects of changes to this template's code. The same also holds for any other template. Otherwise, you may have to wait several minutes before the wiki starts using the new code.

Always give a template a category, even if it is Category:Test Templates. For help on how a template works, read some documentation.

Current Test: leading article

Template Effects

  • an igloo
  • An Igloo
  • a tent
  • A Tent
  • an Igloo
  • a Tent