Difference between revisions of "Template:Image/doc"

From BotE Wiki
Jump to: navigation, search
(new)
 
(Added description for new parameters)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{{See also|T:Image-png}}
+
{{See also|Template:Image-png}}
 
The template '''image''' is used for easier image placement.
 
The template '''image''' is used for easier image placement.
<pre><nowiki>{{image|}}
+
<pre><nowiki>{{image|}}</nowiki></pre>
 +
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.
 +
<pre><nowiki>{{image|Planets/Han1.png}}
 
or
 
or
 +
http://birth-of-the-empires.de/wiki_files/Bilder/Planets/Han1.png</nowiki></pre>
 +
result both in:<br />
 +
{{image|Planets/Han1.png}}
 +
 +
=== Second parameter ===
 +
With the second parameter a wiki link can be added to the image.<br />
 +
<pre><nowiki>{{image|Planets/Han3.png|Main_Page}}</nowiki></pre>
 +
{{image|Planets/Han3.png|Main_Page}}
 +
 +
=== Third parameter ===
 +
With the third parameter a external link can be added to the image. The second parameter must stay empty.<br />
 +
<pre><nowiki>{{image|Planets/Han5.png||http://hp.birth-of-the-empires.de/}}</nowiki></pre>
 +
{{image|Planets/Han5.png||http://hp.birth-of-the-empires.de/}}
  
{{image||}}</nowiki></pre>
 
  
 +
== 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|Planets/Han1.png|width=150}}</nowiki></pre>
 +
{{image|Planets/Han1.png|width=150}}
  
== Examples ==
 
<pre><nowiki>{{image|Planets/Han1.png}}</nowiki></pre>
 
without the template:<br />
 
<pre><nowiki>http://birth-of-the-empires.de/wiki_files/Bilder/Planets/Han1.png</nowiki></pre>
 
result both in:<br />
 
{{image|Planets/Han1.png}}
 
  
 +
With "%" the width parameter uses x% of the available space e.g.: the screen width.
 +
<pre><nowiki>{{image|width=10%|Planets/Han3.png|Main_Page}}</nowiki></pre>
 +
{{image|width=10%|Planets/Han3.png|Main_Page}}
  
With the second parameter a link can be added to the image.<br />
+
=== Height ===
<pre><nowiki>{{image|Planets/Han3.png|Main_Page}}</nowiki></pre>
+
The height parameter works the same way as the width parameter. With both combined an image can be stretched in every direction.
{{image|Planets/Han3.png|Main_Page}}
+
<pre><nowiki>{{image|Planets/Han5.png||http://hp.birth-of-the-empires.de/|width=75|height=100}}</nowiki></pre>
 +
{{image|Planets/Han5.png||http://hp.birth-of-the-empires.de/|width=75|height=100}}

Latest revision as of 17:13, 8 September 2013

See also: Template:Image-png

The template image is used for easier image placement.

{{image|}}

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|Planets/Han1.png}}
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|Planets/Han3.png|Main_Page}}

Third parameter

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

{{image|Planets/Han5.png||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|Planets/Han1.png|width=150}}


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

{{image|width=10%|Planets/Han3.png|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|Planets/Han5.png||http://hp.birth-of-the-empires.de/|width=75|height=100}}