Template:Click: Difference between revisions

From The Urban Dead Wiki
Jump to navigationJump to search
mNo edit summary
(Now works for images of any height, and widths upto 5 times the height)
Line 1: Line 1:
<div style="position: relative; width: {{{width}}}; height: {{{height}}}; overflow: hidden">
<includeonly><div style="position:relative; width:{{{width}}}; height:{{{height}}}; overflow:hidden"><div style="position:absolute; top:0; left:0">[[Image:{{{image}}}|{{{width}}}]]</div>
<div style="position: absolute; top: 0px; left: 0px; font-size: 100px; overflow: hidden; line-height: 100px; z-index: 3">[[{{{link}}}|&nbsp;&nbsp;&nbsp;]]</div>
<div style="position:absolute; top:0; left:0; font-size:{{{height}}}; line-height:1; overflow:hidden">[[{{{link|Example Page}}}|&emsp;&emsp;&emsp;&emsp;&emsp;]]</div></div></includeonly><noinclude>
<div style="position: absolute; top: 0px; left: 0px; z-index: 2">[[Image:{{{image}}}|{{{width}}}|{{{link}}}]]</div></div><noinclude>
===Usage===
===Usage===
Image as clickable link, invoke as follows:
Give images your own link.
{| class="wikitable"
 
! Code !! Note
*''link'' and ''image'' don't need square brackets.
|-
*''height'' and ''width'' must be specified in px and should match the image's size.
|<pre>
*Warning: This will fail for images over five times wider than they are tall, the link will not extend across the whole way.
*Note: Not recommended for signature images, stick with image redirects.
 
===Example===
<pre>
{{Click
{{Click
  |link=  
  |link=Example Page
  |image=  
  |image=Example.jpg
  |height=  
  |width=200px
  |width=  
  |height=150px
}}
}}
</pre>
</pre>
|
Will produce:
*Image and Link needs no brackets, e.g. {{CodeInline|<nowiki>|link= Main Page</nowiki>}}
{{Click
*Height and Weight needs a measurement, e.g. {{CodeInline|<nowiki>|height= 100px</nowiki>}}
|link=Example Page
*Displays {{CodeInline|<nowiki>[[Image:{{{image}}}|{{{width}}}|{{{link}}}]]</nowiki>}}
|image=Example.jpg
|}
|width=200px
[[Category:Utility Templates]]</noinclude>
|height=150px
}}
 
[[Category:Utility Templates|{{PAGENAME}}]]</noinclude>

Revision as of 18:35, 1 March 2010

Usage

Give images your own link.

  • link and image don't need square brackets.
  • height and width must be specified in px and should match the image's size.
  • Warning: This will fail for images over five times wider than they are tall, the link will not extend across the whole way.
  • Note: Not recommended for signature images, stick with image redirects.

Example

{{Click
 |link=Example Page
 |image=Example.jpg
 |width=200px
 |height=150px
}}

Will produce: