Jump to content
Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:ScaleImage: Difference between revisions

Template page
No edit summary
No edit summary
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly>[[File:{{{imagename}}}|{{ #if:{{#pos:{{{newwidth|100}}}|px}}|{{{newwidth|100}}}| {{#expr: ({{#imgw: {{{imagename}}} }} * {{{newwidth|100}}}) / 100 }}px }}|{{{caption|}}}]]</includeonly>
<includeonly>[[File:{{{imagename}}}|{{ #if:{{#pos:{{{newwidth|100}}}|px}}|{{{newwidth|100}}}| {{#expr: ({{#imgw: {{{imagename}}} }} * {{{newwidth|100}}}) / 100 }}px }}|text-top|{{{caption|}}}]]</includeonly>
 
<noinclude>
<noinclude>
<br /><br /><br />
__TOC__
__TOC__
==EXAMPLE ON HOW TO USE THE TEMPLATE==
==EXAMPLE ON HOW TO USE THE TEMPLATE==
Line 10: Line 8:
|newwidth=50px
|newwidth=50px
}}
}}
Copy and paste the code below to the page you wish to add an image:
<pre>
{{ScaleImage
|imagename=image.jpg
|caption=myImage
|newwidth=50px
}}
</pre>
Then replace the content of the variables with your own, for example :
  Replace
            imagename=image.jpg 
  With
            <span style="color:red">imagename=my_image.jpg</span>
===List of Variables===
* <b>imagename</b> : This variable expects from the editor to assign to it an image. You must first upload an image using the upload file option of the toolbox available on the left column of the page. This option is visible if and only if you are logged in.
* <b>caption</b> : This variable expects from the editor to assign to it the caption of the image. Caption is a short explanation of the image that appears when the user has his or her mouse pointer over the image.
* <b>newwidth</b> : This variable expects from the editor to assign to it the width of the image. New width=15,scales the image to 15%, new width=80px,scales the image to 80px.
[[Category:T/Media]]
</noinclude>
</noinclude>