Difference between revisions of "Template:Thumb2"

From WikiDelia
Jump to navigationJump to search
Line 1: Line 1:
<!-- Template for thumbnails of larger images with optional alternative title.
+
<!--
    If the alternative title is omitted, the basename of the Image filename is used.
+
Template for thumbnails of larger images with optional alternative title.
  -- Usage: {{Thumb|DD160123}} displays DD160123.jpg with DD160123 as the image title
+
If the alternative title is omitted, the basename of the Image filename is used.
  --       {{Thumb|DD160123|The Impromptu of Muswell Hill}} gives a different title
+
Usage: {{Thumb|DD160123}} displays DD160123.jpg with DD160123 as the image title
  --       {{Thumb|DD160123|}} gives no title
+
       {{Thumb|DD160123|The Impromptu of Muswell Hill}} gives a different title
 +
       {{Thumb|DD160123|}} gives no title
  
  -- This experimental version of {{Thumb}} made to allow {{Thumb|Whatever.png}} or .pdf
+
This experimental version of {{Thumb}} made to allow {{Thumb|Whatever.png}} or .pdf
  -- i.e. it adds ".jpg" to the filename only if the filename has no extension
+
i.e. it adds ".jpg" to the filename only if the filename has no extension
  -- and, for the default title to display,
+
and, for the default title to display,
  -- removes the filename suffix if it one was given.
+
removes the filename suffix if it one was given.
  -- It doesn't work, I think because the {{#switch is processed too early,
+
It doesn't work, I think because the {{#switch is processed too early,
  -- before the calling page has supplied the parameter value to switch on.
+
before the calling page has supplied the parameter value to switch on.
 
-->[[Image:{{{1}}}{{#switch: {{#invoke:String|sub|{{{1}}}|-4}}
 
-->[[Image:{{{1}}}{{#switch: {{#invoke:String|sub|{{{1}}}|-4}}
 +
| .gif =
 
  | .jpg =
 
  | .jpg =
 
  | .pdf =
 
  | .pdf =
 
  | .png =
 
  | .png =
  | default .jpg
+
  | .jpg
 
}}|thumb|right|{{{2|{{{1}}}}}}]]
 
}}|thumb|right|{{{2|{{{1}}}}}}]]

Revision as of 21:13, 23 May 2016

[[Image:{{{1}}}.jpg|thumb|right|{{{1}}}]]