Template:Image/doc: Difference between revisions
Jump to navigation
Jump to search
(Created page with "== Description == This template is used to display images with a consistent style, allowing for optional width and caption parameters. === Usage === To use this template, insert the following code into your page: <syntaxhighlight lang="wikitext"> {{Image|filename|width=optional_width|caption=optional_caption}} </syntaxhighlight> * '''filename''' – The name of the image file to display. * '''width''' (optional) – The width of the image (default is 200px). * '''capti...") |
No edit summary |
||
Line 1: | Line 1: | ||
== | == Usage == | ||
This template is used to display images with a consistent style, allowing for optional width and caption parameters. | This template is used to display images with a consistent style, allowing for optional width and caption parameters. | ||
To use this template, insert the following code into your page: | To use this template, insert the following code into your page: | ||
<syntaxhighlight lang="wikitext"> | <syntaxhighlight lang="wikitext"> | ||
Line 12: | Line 11: | ||
* '''caption''' (optional) – The caption to display below the image. | * '''caption''' (optional) – The caption to display below the image. | ||
== Examples == | |||
'''Example 1: Basic usage''' | '''Example 1: Basic usage''' | ||
<syntaxhighlight lang="wikitext"> | <syntaxhighlight lang="wikitext"> | ||
Line 31: | Line 30: | ||
This will display the image `Example.jpg` with a width of 300px and the caption "This is an example image". | This will display the image `Example.jpg` with a width of 300px and the caption "This is an example image". | ||
== Template Code == | |||
< | <syntaxhighlight lang="html"> | ||
<div style="float: right; clear: both; margin: 1em 0 1em 1em; width: {{{width|200px}}};"> | <div style="float: right; clear: both; margin: 1em 0 1em 1em; width: {{{width|200px}}};"> | ||
<div class="thumb" style="width: {{{width|200px}}};"> | <div class="thumb" style="width: {{{width|200px}}};"> | ||
Line 40: | Line 39: | ||
</div> | </div> | ||
</div> | </div> | ||
</ | </syntaxhighlight> | ||
== Additional Notes == | |||
* Ensure the image file is uploaded to the wiki. | * Ensure the image file is uploaded to the wiki. | ||
* You can adjust the default width by changing the `200px` value in the template code. | * You can adjust the default width by changing the `200px` value in the template code. | ||
Line 50: | Line 49: | ||
* [[Help:Images]] – For more information on uploading and managing images. | * [[Help:Images]] – For more information on uploading and managing images. | ||
* [[Template:Documentation]] – For information on how to document templates. | * [[Template:Documentation]] – For information on how to document templates. | ||
Latest revision as of 15:41, 21 July 2024
Usage
This template is used to display images with a consistent style, allowing for optional width and caption parameters.
To use this template, insert the following code into your page:
{{Image|filename|width=optional_width|caption=optional_caption}}
- filename – The name of the image file to display.
- width (optional) – The width of the image (default is 200px).
- caption (optional) – The caption to display below the image.
Examples
Example 1: Basic usage
{{Image|Example.jpg}}
This will display the image `Example.jpg` with the default width of 200px and no caption.
Example 2: Custom width
{{Image|Example.jpg|width=300px}}
This will display the image `Example.jpg` with a width of 300px and no caption.
Example 3: Custom width and caption
{{Image|Example.jpg|width=300px|caption=This is an example image}}
This will display the image `Example.jpg` with a width of 300px and the caption "This is an example image".
Template Code
<div style="float: right; clear: both; margin: 1em 0 1em 1em; width: {{{width|200px}}};">
<div class="thumb" style="width: {{{width|200px}}};">
<div class="thumbinner">
[[File:{{{1}}}|thumb|{{{width|200px}}}|{{{caption|}}}]]
</div>
</div>
</div>
Additional Notes
- Ensure the image file is uploaded to the wiki.
- You can adjust the default width by changing the `200px` value in the template code.
- This template helps maintain a consistent look for images across the wiki.
See Also
- Help:Images – For more information on uploading and managing images.
- Template:Documentation – For information on how to document templates.