Difference between revisions of "Template:Navimg"

From Worms Knowledge Base

Jump to: navigation, search
(one last fix (I hope))
(fix the code & add description text)
Line 1: Line 1:
{{#if:{{{inline|}}}|<span /><div class="imagemap-inline" style="display:inline;">}}{{#tag:imagemap|
+
<includeonly>{{#if:{{{inline|}}}|<span /><div class="imagemap-inline" style="display:inline;">}}{{#tag:imagemap|
Image:{{{image|{{{1}}}}}}{{#if:{{{size|}}}{{{xsize|}}}{{{width|}}}{{{4|}}}|{{!}}{{{size|{{{xsize|{{{width|{{{4}}}}}}}}}}}}px}}{{!}}{{{Alt|{{{tooltip|{{{3|{{{link|{{{2|&nbsp;}}}}}}}}}}}}}}}
+
Image:{{{image|{{{1}}}}}}{{#if:{{{size|}}}{{{xsize|}}}{{{width|}}}{{{4|}}}|{{!}}{{{size|{{{xsize|{{{width|{{{4}}}}}}}}}}}}px}}{{!}}{{{alt|{{{tooltip|{{{3|{{{link|{{{2|&nbsp;}}}}}}}}}}}}}}}
 
{{#if:{{{link|}}}{{{2|}}}
 
{{#if:{{{link|}}}{{{2|}}}
 
  |
 
  |
 
default {{#switch: {{#titleparts:{{{link|{{{2}}}}}}|1|1}}
 
default {{#switch: {{#titleparts:{{{link|{{{2}}}}}}|1|1}}
  |Http:|Https:|Ftp:|Ftps: = [{{{link|{{{2}}}}}} {{{tooltip|{{{link|{{{2}}}}}}}}}]
+
  |Http:|Https:|Ftp:|Ftps: = [{{{link|{{{2}}}}}} {{{tooltip|{{{3|{{{link|{{{2}}}}}}}}}}}}]
  |#default = [[{{{link|{{{2}}}}}}|{{{tooltip|{{{link|{{{2}}}}}}}}}]] }}
+
  |#default = [[{{{link|{{{2}}}}}}|{{{tooltip|{{{3|{{{link|{{{2}}}}}}}}}}}}]] }}
 
desc {{{desc|none}}}
 
desc {{{desc|none}}}
 
}}
 
}}
 
{{{form|}}}
 
{{{form|}}}
}}{{#if:{{{inline|}}}|</div>}}
+
}}{{#if:{{{inline|}}}|</div>}}</includeonly><noinclude>
 +
===Usage===
 +
<nowiki>{{</nowiki> Navimg<br/>
 +
| image = ''file.png''<br/>
 +
| link = ''image link'' (e.g. ''[[Main Page]]'' (internal link) or ''http://worms2d.info/'' (external))<br/>
 +
| tooltip = ''tooltip''<br/>
 +
| size / xsize / width = ''image size'' (e.g. ''100'' or ''200x150'')<br/>
 +
| alt = ''alternate text''<br/>
 +
<nowiki>}}</nowiki>
 +
 
 +
<nowiki>{{ Navimg | image | link | tooltip | size }}</nowiki>
 +
 
 +
===Notes===
 +
* If the "alt" parameter is not specified, the alt text will be the same as the tooltip.
 +
* Do not add square brackets in the "link" parameter. (use <code>Main Page|WKB</code> instead of <code><nowiki>[[Main Page|WKB]]</nowiki></code>, for example)
 +
</noinclude>

Revision as of 06:21, 28 November 2009

Usage

{{ Navimg
| image = file.png
| link = image link (e.g. Main Page (internal link) or http://worms2d.info/ (external))
| tooltip = tooltip
| size / xsize / width = image size (e.g. 100 or 200x150)
| alt = alternate text
}}

{{ Navimg | image | link | tooltip | size }}

Notes

  • If the "alt" parameter is not specified, the alt text will be the same as the tooltip.
  • Do not add square brackets in the "link" parameter. (use Main Page|WKB instead of [[Main Page|WKB]], for example)
Personal tools