Template:Image: Difference between revisions

From Know Islam
Jump to navigation Jump to search
No edit summary
Tag: Reverted
(Undo revision 622 by Menj (talk))
Tag: Undo
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Image|Example.jpg|width=300px|caption=This is an example image}}
<includeonly>
 
 
<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: 100%;">
         <div class="thumbinner">
         <div class="thumbinner">
             [[File:{{{1}}}|thumb|{{{width|200px}}}|{{{caption|}}}]]
             [[File:{{{1}}}|thumb|{{{width|200px}}}|{{{caption|}}}]]
Line 9: Line 7:
     </div>
     </div>
</div>
</div>
 
</includeonly>
<noinclude>{{documentation}}</noinclude>
<noinclude>
== Documentation ==
{{:Template:Image/doc}}
</noinclude>

Latest revision as of 15:44, 21 July 2024


Documentation

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