Actions

JDOC

Difference between revisions of "Otheruses templates (example usage)"

From Joomla! Documentation

m (1 revision(s))
 
m (wrong shortcut)
 
(2 intermediate revisions by one user not shown)
Line 1: Line 1:
{{shortcut|WP:OTEU}}
+
{{shortcut|JDOC:OTEU}}
 
This table illustrates the various applications of the [[Template:Otheruses templates|otheruses templates]]. For each template listed, the results are shown of using it with each valid combination of parameters.
 
This table illustrates the various applications of the [[Template:Otheruses templates|otheruses templates]]. For each template listed, the results are shown of using it with each valid combination of parameters.
  
Line 13: Line 13:
 
![[template:dablink|dablink]]
 
![[template:dablink|dablink]]
 
| 
 
| 
|{{dablink|a}}
+
|{{dablink|PAGE}}
 
| 
 
| 
 
| 
 
| 
Line 21: Line 21:
 
![[template:otheruses|otheruses]]
 
![[template:otheruses|otheruses]]
 
|{{otheruses}}
 
|{{otheruses}}
|{{otheruses|a}}
+
|{{otheruses|PAGE}}
 
| 
 
| 
 
| 
 
| 
Line 29: Line 29:
 
![[template:otheruses2|otheruses2]]
 
![[template:otheruses2|otheruses2]]
 
| 
 
| 
|{{otheruses2|a}}
+
|{{otheruses2|PAGE}}
 
| 
 
| 
 
| 
 
| 
Line 37: Line 37:
 
![[template:otheruses3|otheruses3]]
 
![[template:otheruses3|otheruses3]]
 
| 
 
| 
|{{otheruses3|a}}
+
|{{otheruses3|PAGE}}
 
| 
 
| 
 
| 
 
| 
Line 45: Line 45:
 
![[template:otheruses4|otheruses4]]
 
![[template:otheruses4|otheruses4]]
 
|{{otheruses4}}
 
|{{otheruses4}}
|{{otheruses4|a}}
+
|{{otheruses4|PAGE}}
|{{otheruses4|a|b}}
+
|{{otheruses4|PAGE1|PAGE2}}
|{{otheruses4|a|b|c}}
+
|{{otheruses4|PAGE1|PAGE2|PAGE3}}
 
| 
 
| 
 
| 
 
| 
Line 55: Line 55:
 
| 
 
| 
 
| 
 
| 
|{{two other uses|a|b|c}}
+
|{{two other uses|PAGE1|PAGE2|PAGE3}}
|{{two other uses|a|b|c|d}}
+
|{{two other uses|PAGE1|PAGE2|PAGE3|PAGE4}}
|{{two other uses|a|b|c|d|e}}
+
|{{two other uses|PAGE1|PAGE2|PAGE3|PAGE4|PAGE5}}
|-
+
![[template:otherpersons|otherpersons]]
+
|{{otherpersons}}
+
|{{otherpersons|a}}
+
| 
+
| 
+
| 
+
| 
+
|-
+
![[template:otherpeople2|otherpeople2]]
+
| 
+
|{{otherpeople2|a}}
+
| 
+
| 
+
| 
+
| 
+
|-
+
![[template:otherpeople3|otherpeople3]]
+
|{{otherpeople3}}
+
|{{otherpeople3|a}}
+
|{{otherpeople3|a|b}}
+
|{{otherpeople3|a|b|c}}
+
| 
+
| 
+
|-
+
![[template:otherhurricaneuses|otherhurricaneuses]]
+
|{{otherhurricaneuses}}
+
|{{otherhurricaneuses|a}}
+
|{{otherhurricaneuses|a|b}}
+
| 
+
| 
+
| 
+
|-
+
![[template:otherhurricaneuses3|otherhurricaneuses3]]
+
| 
+
| 
+
| 
+
|{{otherhurricaneuses3|a|b|c}}
+
|{{otherhurricaneuses3|a|b|c|d}}
+
| 
+
 
|-
 
|-
 
![[template:For|For]]
 
![[template:For|For]]
 
| 
 
| 
|{{For|a}}
+
|{{For|PAGE}}
|{{For|a|b}}
+
|{{For|PAGE1|PAGE2}}
|{{For|a|b|c}}
+
|{{For|PAGE1|PAGE2|PAGE3}}
 
| 
 
| 
 
| 
 
| 
Line 110: Line 70:
 
| 
 
| 
 
| 
 
| 
|{{For2|a|b}}
+
|{{For2|PAGE1|PAGE2}}
 
| 
 
| 
 
| 
 
| 
Line 117: Line 77:
 
![[template:otherusesof|otherusesof]]
 
![[template:otherusesof|otherusesof]]
 
|{{otherusesof}}
 
|{{otherusesof}}
|{{otherusesof|a}}
+
|{{otherusesof|PAGE}}
|{{otherusesof|a|b}}
+
|{{otherusesof|PAGE1|PAGE2}}
 
| 
 
| 
 
| 
 
| 
Line 125: Line 85:
 
![[template:redirect|redirect]]
 
![[template:redirect|redirect]]
 
| 
 
| 
|{{redirect|a}}
+
|{{redirect|PAGE}}
|{{redirect|a|b}}
+
|{{redirect|PAGE1|PAGE2}}
|{{redirect|a|b|c}}
+
|{{redirect|PAGE1|PAGE2|PAGE3}}
 
| 
 
| 
 
| 
 
| 
Line 134: Line 94:
 
| 
 
| 
 
| 
 
| 
|{{redirect2|a|b}}
+
|{{redirect2|PAGE1|PAGE2}}
|{{redirect2|a|b|c}}
+
|{{redirect2|PAGE1|PAGE2|PAGE3}}
 
| 
 
| 
 
| 
 
| 
Line 142: Line 102:
 
| 
 
| 
 
| 
 
| 
|{{redirect3|a|b}}
+
|{{redirect3|PAGE1|PAGE2}}
 
| 
 
| 
 
| 
 
| 
Line 150: Line 110:
 
| 
 
| 
 
| 
 
| 
|{{redirect4|a|b}}
+
|{{redirect4|PAGE1|PAGE2}}
 
| 
 
| 
 
| 
 
| 
Line 159: Line 119:
 
| 
 
| 
 
| 
 
| 
|{{redirect6|a|b|c}}
+
|{{redirect6|PAGE1|PAGE2|PAGE3}}
|{{redirect6|a|b|c|d}}
+
|{{redirect6|PAGE1|PAGE2|PAGE3|PAGE4}}
|{{redirect6|a|b|c|d|e}}
+
|{{redirect6|PAGE1|PAGE2|PAGE3|PAGE5|PAGE6}}
 
|-
 
|-
 
![[template:distinguish|distinguish]]
 
![[template:distinguish|distinguish]]
 
| 
 
| 
|{{distinguish|a}}
+
|{{distinguish|PAGE}}
|{{distinguish|a|b}}
+
|{{distinguish|PAGE1|PAGE2}}
|{{distinguish|a|b|c}}
+
|{{distinguish|PAGE1|PAGE2|PAGE3}}
|{{distinguish|a|b|c|d}}
+
|{{distinguish|PAGE1|PAGE2|PAGE3|PAGE4}}
 
| 
 
| 
 
|-
 
|-
 
![[template:distinguish2|distinguish2]]
 
![[template:distinguish2|distinguish2]]
 
| 
 
| 
|{{distinguish2|a}}
+
|{{distinguish2|PAGE}}
 
| 
 
| 
 
| 
 
| 
Line 183: Line 143:
 
==Notes==
 
==Notes==
 
*Some of the templates refer to the name of the page they are on, in this case "''{{PAGENAME}}''". When used on another page, this will be replaced by the name of the page on which it is used.
 
*Some of the templates refer to the name of the page they are on, in this case "''{{PAGENAME}}''". When used on another page, this will be replaced by the name of the page on which it is used.
*The [[Perl]] code to reproduce this table is included in [{{fullurl:{{FULLPAGENAME}}|action=edit}} the source of the page].
 
 
<!--
 
#!/usr/bin/perl -w
 
 
use strict;
 
 
my $ShowBadUses = 0;
 
 
# Each entry here specifies a template name followed by the minimum and
 
#  maximum sensible number of parameters for that template.
 
my @Templates = (
 
  [ "dablink",              1, 1, ],
 
  [ "otheruses",            0, 1, ],
 
  [ "otheruses2",            1, 1, ],
 
  [ "otheruses3",            1, 1, ],
 
  [ "otheruses4",            0, 3, ],
 
  [ "two other uses",        3, 5, ],
 
  [ "otherpersons",          0, 1, ],
 
  [ "otherpeople2",          1, 1, ],
 
  [ "otherpeople3",          0, 3, ],
 
  [ "otherhurricaneuses",    0, 2, ],
 
  [ "otherhurricaneuses3",  3, 4, ],
 
  [ "For",                  1, 3, ],
 
  [ "For2",                  2, 2, ],
 
  [ "otheruses4",            0, 3, ],
 
  [ "otherusesof",          0, 2, ],
 
  [ "redirect",              1, 3, ],
 
  [ "redirect2",            2, 3, ],
 
  [ "redirect3",            2, 2, ],
 
  [ "redirect4",            2, 2, ],
 
  [ "redirect5",            3, 3, ],
 
  [ "redirect6",            3, 5, ],
 
  [ "distinguish",          1, 4, ],
 
  [ "distinguish2",          1, 1, ],
 
);
 
 
my $columns;
 
{
 
  my $max = $Templates[0][2];
 
  foreach (@Templates) {
 
    $max = $_->[2]
 
      if ($_->[2] > $max);
 
  }
 
  $columns = $max + 1;
 
}
 
 
$columns++
 
  if ($ShowBadUses);
 
 
my @Params;
 
{
 
  my $p = "a";
 
  for (my $i=0; $i<$columns-1; $i++) {
 
    push @Params, $p++;
 
  }
 
}
 
 
print "{| class=\"wikitable\"\n";
 
 
# Print header line.
 
print "!&nbsp;\n";
 
print "!0 parameters";
 
print "<br />";
 
print "<nowiki>{{</nowiki>''name''}}\n";
 
for (my $i=1; $i<$columns; $i++) {
 
  print "!$i parameter" . ($i == 1 ? "" : "s");
 
  print "<br />";
 
  print "<nowiki>{{</nowiki>''name''&#124;" . join("&#124;", @Params[0..$i-1]) . "}}\n";
 
}
 
print "|-\n";
 
 
foreach (@Templates) {
 
  my ($name, $min, $max)  = @$_;
 
 
  # Print line header cell.
 
  print "![[template:$name|$name]]\n";
 
 
  # Print the content cells.
 
  for (my $i=0; $i<$columns; $i++) {
 
    my $link;
 
 
    if ($i == 0) {
 
      $link = $name;
 
    } else {
 
      $link = $name . "|" . join("|", @Params[0..$i-1]);
 
    }
 
 
    if ($i >= $min && $i <= $max) {
 
      print "|{{$link}}\n";
 
    } elsif ($ShowBadUses) {
 
      print "|style=\"background:silver\"|{{$link}}\n";
 
    } else {
 
      print "|&nbsp;\n";
 
    }
 
  }
 
 
  print "|-\n";
 
}
 
print "|}\n";
 
-->
 
  
 
[[Category:Disambiguation and redirection templates|Otheruses templates (example usage)]]
 
[[Category:Disambiguation and redirection templates|Otheruses templates (example usage)]]

Latest revision as of 04:52, 11 May 2008

Shortcut:
JDOC:OTEU

This table illustrates the various applications of the otheruses templates. For each template listed, the results are shown of using it with each valid combination of parameters.

  0 parameters
{{name}}
1 parameter
{{name|a}}
2 parameters
{{name|a|b}}
3 parameters
{{name|a|b|c}}
4 parameters
{{name|a|b|c|d}}
5 parameters
{{name|a|b|c|d|e}}
dablink          
otheruses        
otheruses2          
otheruses3          
otheruses4    
two other uses      
For      
For2          
otherusesof      
redirect      
redirect2        
redirect3          
redirect4          
redirect6      
distinguish    
distinguish2          

Notes

  • Some of the templates refer to the name of the page they are on, in this case "Otheruses templates (example usage)". When used on another page, this will be replaced by the name of the page on which it is used.