Difference between revisions of "Template:Navimg"

From Worms Knowledge Base

Jump to: navigation, search
m (The inline parameter doesn't work according to my testing. I'll remove it)
(bring the "inline" parameter back)
 
(11 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>{{#tag:imagemap|
+
<includeonly>{{#if:{{{inline|}}}|<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|{{{3|{{{link|{{{2}}}}}}}}}}}}]
 
  |Http:|Https:|Ftp:|Ftps: = [{{{link|{{{2}}}}}} {{{tooltip|{{{3|{{{link|{{{2}}}}}}}}}}}}]
 
  |#default = [[{{{link|{{{2}}}}}}|{{{tooltip|{{{3|{{{link|{{{2}}}}}}}}}}}}]] }}
 
  |#default = [[{{{link|{{{2}}}}}}|{{{tooltip|{{{3|{{{link|{{{2}}}}}}}}}}}}]] }}
desc {{{desc|none}}}
+
desc none
 
}}
 
}}
{{{form|}}}
+
}}{{#if:{{{inline|}}}|</div>}}</includeonly><noinclude>__NOTOC__
}}</includeonly><noinclude>__NOTOC__
+
 
===Usage===
 
===Usage===
<nowiki>{{</nowiki> Navimg<br/>
+
&#123;&#123; Navimg<br/>
 
| image (1) = ''file.png''<br/>
 
| image (1) = ''file.png''<br/>
 
| link (2) = ''image link'' (e.g. ''[[Main Page]]'' (internal link) or ''http://worms2d.info/'' (external link))<br/>
 
| link (2) = ''image link'' (e.g. ''[[Main Page]]'' (internal link) or ''http://worms2d.info/'' (external link))<br/>
Line 17: Line 15:
 
| size (4) / xsize / width = ''image size'' (e.g. ''100'' or ''200x150'')<br/>
 
| size (4) / xsize / width = ''image size'' (e.g. ''100'' or ''200x150'')<br/>
 
| alt = ''alternate text''<br/>
 
| alt = ''alternate text''<br/>
| desc = option to show the image description link or not. Can be <code>top-right</code>, <code>bottom-right</code>, <code>bottom-left</code>, <code>top-left</code>, or <code>none</code><br/>
+
| inline = ''set "1" for inline image''<br/>
| form = other items you wish to put on the image map
+
&#125;&#125;
<nowiki>}}</nowiki>
+
  
<nowiki>{{ Navimg | image | link | tooltip | size }}</nowiki>
+
&#123;&#123; Navimg | image | link | tooltip | size }}&#125;&#125;
  
 
The "image" and "link" parameter are required; the others are optional.
 
The "image" and "link" parameter are required; the others are optional.
  
 
===Notes===
 
===Notes===
 +
* This template is deprecated. The new wiki syntax &#91;&#91;File:Example.jpg|link=Link title&#93;&#93; (introduced in MediaWiki 1.14) could work the same.
 
* If the "alt" parameter is not specified, the alt text will be the same as the tooltip.
 
* 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>
+
* Do not add square brackets in the "link" parameter. (use <code>Main Page</code> instead of <code><nowiki>[[Main Page]]</nowiki></code>, for example)
 +
* The equal sign "<code>=</code>" in URLs '''must be escaped with <code>&#123;&#123;=&#125;&#125;</code>''' if used in the unnamed parameter. For example: <code>&#123;&#123;navimg|Wkblarge.png|<nowiki>http://worms2d.info/?title</nowiki>'''&#123;&#123;=&#125;&#125;'''Main_Page&#125;&#125;</code>
 +
 
 +
</noinclude>

Latest revision as of 01:30, 6 November 2010

Usage

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

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

The "image" and "link" parameter are required; the others are optional.

Notes

  • This template is deprecated. The new wiki syntax [[File:Example.jpg|link=Link title]] (introduced in MediaWiki 1.14) could work the same.
  • 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 instead of [[Main Page]], for example)
  • The equal sign "=" in URLs must be escaped with {{=}} if used in the unnamed parameter. For example: {{navimg|Wkblarge.png|http://worms2d.info/?title{{=}}Main_Page}}


Personal tools