Template:Image: Difference between revisions

From Know Islam
Jump to navigation Jump to search
No edit summary
(Undo revision 622 by Menj (talk))
Tag: Undo
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Purpose ==
<includeonly>
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).
* '''caption''' (optional) – The caption to display below the image.
 
=== Examples ===
'''Example 1: Basic usage'''
<syntaxhighlight lang="wikitext">
{{Image|Example.jpg}}
</syntaxhighlight>
This will display the image `Example.jpg` with the default width of 200px and no caption.
 
'''Example 2: Custom width'''
<syntaxhighlight lang="wikitext">
{{Image|Example.jpg|width=300px}}
</syntaxhighlight>
This will display the image `Example.jpg` with a width of 300px and no caption.
 
'''Example 3: Custom width and caption'''
<syntaxhighlight lang="wikitext">
{{Image|Example.jpg|width=300px|caption=This is an example image}}
</syntaxhighlight>
This will display the image `Example.jpg` with a width of 300px and the caption "This is an example image".
 
=== Template Code ===
<source 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: 100%;">
         <div class="thumbinner">
         <div class="thumbinner">
             [[File:{{{1}}}|thumb|{{{width|200px}}}|{{{caption|}}}]]
             [[File:{{{1}}}|thumb|{{{width|200px}}}|{{{caption|}}}]]
Line 40: Line 7:
     </div>
     </div>
</div>
</div>
</source>
</includeonly>
 
=== 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.
 
== Template Documentation ==
<noinclude>
<noinclude>
{{documentation}}
== Documentation ==
{{:Template:Image/doc}}
</noinclude>
</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