Difference between revisions of "Template:Thumb2"
From WikiDelia
Jump to navigationJump to searchMartinwguy (talk | contribs) |
Martinwguy (talk | contribs) (Undo revisions 11895 and 11894) |
||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | <!-- Template for thumbnails of larger images with optional alternative title. | + | <!-- |
− | + | Template for thumbnails of larger images with optional alternative title. | |
− | + | If the alternative title is omitted, the basename of the Image filename is used. | |
− | + | Usage: {{Thumb|DD160123}} displays DD160123.jpg with DD160123 as the image 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 | |
− | + | i.e. it adds ".jpg" to the filename only if the filename has no extension | |
− | + | and, for the default title to display, | |
− | + | removes the filename suffix if it one was given. | |
− | + | 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. | |
− | -->[[Image:{{{1}}}{{#switch: {{#invoke:String|sub|{{{1}}}|-4}} | + | -->[[Image:{{{1}}}{{#switch:{{#invoke:String|sub|{{{1}}}|-4}}|.gif=|.jpg=|.pdf=|.png=|.jpg}}|thumb|right|{{{2|{{{1}}}}}}]] |
− | |||
− | |||
− | |||
− | |||
− | }}|thumb|right|{{{2|{{{1}}}}}}]] |
Latest revision as of 21:22, 23 May 2016
[[Image:{{{1}}}.jpg|thumb|right|{{{1}}}]]