This wiki is closed in favour of the new wiki. Information shown is likely to be very out of date. |
Difference between revisions of "Template:Thumbmaker"
From Discovery Wiki
Jump to navigationJump to searchLine 15: | Line 15: | ||
* If a Size parameter is provided, the value is passed to the Image: template as the thumbnail size parameter. If a Size parameter is not provided, a default value of 120px is used. | * If a Size parameter is provided, the value is passed to the Image: template as the thumbnail size parameter. If a Size parameter is not provided, a default value of 120px is used. | ||
+ | |||
+ | Not that the Image: template automatically aligns thumbnails on the right edge of the page. If you want to reposition the thumbnail, you need to enclose it within a <div> tag. | ||
==Usage== | ==Usage== |
Revision as of 16:59, 20 December 2012
This template attempts to display a thumbnail of a named item, and prompts the user to upload an image if a file cannot be located. More specifically:
- The template takes three parameters, which are referred to here as Item Name, Filename, and Size, respectively. Only the Item Name is required.
- If a Filename is not provided, the template looks for File: entries named "Item Name.png" and "Item Name.jpg", in that order (this is the expected default condition).
- If a Filename parameter is provided, the template looks for File: entries named "Filename.png" and "Filename.jpg", in that order. This allows the user to specify an alternative image, rather than using the Item Name.
- If a File: entry is not located, a text string is displayed that requests the user to upload a PNG version of the Item Name.
- If a File: entry is located, the Image: template is called upon to display a thumbnail image of the discovered file, with Item Name as the caption value.
- If a Size parameter is provided, the value is passed to the Image: template as the thumbnail size parameter. If a Size parameter is not provided, a default value of 120px is used.
Not that the Image: template automatically aligns thumbnails on the right edge of the page. If you want to reposition the thumbnail, you need to enclose it within a <div> tag.
Usage
{{Thumbmaker|Planet Manhattan}} {{Thumbmaker|Planet Manhattan|Planet_Malta}} {{Thumbmaker|Planet Manhattan|Planet_Malta|200px}}
Result