Difference between revisions of "Template:Image-png/doc"

From BotE Wiki
Jump to: navigation, search
(Improved parameter explanation)
(Added description for new parameters)
 
Line 2: Line 2:
 
The template '''image-png''' is used for easier image placement of images. Especially for images which have the bob format in BotE and the png format in the wiki. Mainly used in other templates.  
 
The template '''image-png''' is used for easier image placement of images. Especially for images which have the bob format in BotE and the png format in the wiki. Mainly used in other templates.  
 
In contrast to the [[T:image|image template]] the last 3 characters of the first parameter get replaced by "png".
 
In contrast to the [[T:image|image template]] the last 3 characters of the first parameter get replaced by "png".
<pre><nowiki>{{image-png|}}
+
<pre><nowiki>{{image-png|}}</nowiki></pre>
 
+
This template has three unnamed parameters and two named parameters separated by a "|" (vertical bar).
or
 
 
 
{{image-png||}}</nowiki></pre>
 
 
 
This template has three parameters separated by a "|" (vertical bar).
 
 
 
  
 +
== Unnamed parameters ==
 
=== First parameter ===
 
=== First parameter ===
 
The first parameter is for the image path.
 
The first parameter is for the image path.
Line 18: Line 13:
 
result both in:<br />
 
result both in:<br />
 
{{image-png|Planets/Han1.bop}}
 
{{image-png|Planets/Han1.bop}}
 
  
 
=== Second parameter ===
 
=== Second parameter ===
Line 24: Line 18:
 
<pre><nowiki>{{image-png|Planets/Han3.bop|Main_Page}}</nowiki></pre>
 
<pre><nowiki>{{image-png|Planets/Han3.bop|Main_Page}}</nowiki></pre>
 
{{image-png|Planets/Han3.bop|Main_Page}}
 
{{image-png|Planets/Han3.bop|Main_Page}}
 
  
 
=== Third parameter ===
 
=== Third parameter ===
Line 30: Line 23:
 
<pre><nowiki>{{image-png|Planets/Han5.bop||http://hp.birth-of-the-empires.de/}}</nowiki></pre>
 
<pre><nowiki>{{image-png|Planets/Han5.bop||http://hp.birth-of-the-empires.de/}}</nowiki></pre>
 
{{image-png|Planets/Han5.bop||http://hp.birth-of-the-empires.de/}}
 
{{image-png|Planets/Han5.bop||http://hp.birth-of-the-empires.de/}}
 +
 +
 +
== Named parameters ==
 +
The named parameters can be combined with each other and the unnamed parameters. It is unimportant at which position a named parameter is placed.
 +
=== Width ===
 +
The width of an image can be changed with "|width=".
 +
<pre><nowiki>{{image-png|Planets/Han1.bop|width=150}}</nowiki></pre>
 +
{{image-png|Planets/Han1.bop|width=150}}
 +
 +
 +
With "%" the width parameter uses x% of the available space e.g.: the screen width.
 +
<pre><nowiki>{{image-png|width=10%|Planets/Han3.bop|Main_Page}}</nowiki></pre>
 +
{{image-png|width=10%|Planets/Han3.bop|Main_Page}}
 +
 +
=== Height ===
 +
The height parameter works the same way as the width parameter. With both combined an image can be stretched in every direction.
 +
<pre><nowiki>{{image-png|Planets/Han5.bop||http://hp.birth-of-the-empires.de/|width=75|height=100}}</nowiki></pre>
 +
{{image-png|Planets/Han5.bop||http://hp.birth-of-the-empires.de/|width=75|height=100}}

Latest revision as of 17:53, 8 September 2013

See also: Template:Image

The template image-png is used for easier image placement of images. Especially for images which have the bob format in BotE and the png format in the wiki. Mainly used in other templates. In contrast to the image template the last 3 characters of the first parameter get replaced by "png".

{{image-png|}}

This template has three unnamed parameters and two named parameters separated by a "|" (vertical bar).

Unnamed parameters

First parameter

The first parameter is for the image path.

{{image-png|Planets/Han1.bop}}
or
http://birth-of-the-empires.de/wiki_files/Bilder/Planets/Han1.png

result both in:

Second parameter

With the second parameter a wiki link can be added to the image.

{{image-png|Planets/Han3.bop|Main_Page}}

Third parameter

With the third parameter a external link can be added to the image. The second parameter must stay empty.

{{image-png|Planets/Han5.bop||http://hp.birth-of-the-empires.de/}}


Named parameters

The named parameters can be combined with each other and the unnamed parameters. It is unimportant at which position a named parameter is placed.

Width

The width of an image can be changed with "|width=".

{{image-png|Planets/Han1.bop|width=150}}


With "%" the width parameter uses x% of the available space e.g.: the screen width.

{{image-png|width=10%|Planets/Han3.bop|Main_Page}}

Height

The height parameter works the same way as the width parameter. With both combined an image can be stretched in every direction.

{{image-png|Planets/Han5.bop||http://hp.birth-of-the-empires.de/|width=75|height=100}}