Difference between revisions of "Template:Click"

From BattleMaster Wiki
Jump to navigation Jump to search
m (Limitations of the template)
Line 1: Line 1:
 
<includeonly><div style="position: relative; width: {{{width}}}; height: {{{height}}}; overflow: hidden;"><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: 0px; left: 0px; z-index: 2;">[[Image:{{{image}}}|{{{width}}}|{{{link}}}]]</div></div></includeonly><noinclude>
 
<includeonly><div style="position: relative; width: {{{width}}}; height: {{{height}}}; overflow: hidden;"><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: 0px; left: 0px; z-index: 2;">[[Image:{{{image}}}|{{{width}}}|{{{link}}}]]</div></div></includeonly><noinclude>
  '''Usage:''' <nowiki>{{Click | image=myimage.png | link=PageName | width=10px | height=10px}}</nowiki>
+
  '''Usage:''' <nowiki>{{Click | image=myimage.png | link=PageName | width="width"px | height="height"px}}</nowiki>
  
 
This template attempts to superimpose an invisible link on an image, such that clicking on the image does ''not'' take you to the image description page (normal behaviour).
 
This template attempts to superimpose an invisible link on an image, such that clicking on the image does ''not'' take you to the image description page (normal behaviour).
  
 
It's useful for small icons/logos which are representative of an article, and which a user might click on expecting to be taken to that article.
 
It's useful for small icons/logos which are representative of an article, and which a user might click on expecting to be taken to that article.
 +
 +
====Limitations====
 +
These are some things I have noticed while using this template. I'm not enough of an HTML guru to figure out why, let alone fix it.
 +
#Apparently you can only have a max image size of 100 pixels for the thumbnail. This is probably due to the "line-height: 100px;" parameter in the template. I don't know enough about HTML to figure out what would happen if I were to change that parameter. Would it still work in all cases? Why not just use the "height" parameter there, rather than hardcode the line height? I dunno, I copied it from Wikipedia...
 +
#It appears to work best with square thumbnail graphics. (Or possibly with graphics that are taller than they are wide.) I tired a 100px by 79px garphic, and the right side was not completely covered by the hotlink.
  
 
==== See also ====
 
==== See also ====

Revision as of 21:40, 7 January 2008

Usage: {{Click | image=myimage.png | link=PageName | width="width"px | height="height"px}}

This template attempts to superimpose an invisible link on an image, such that clicking on the image does not take you to the image description page (normal behaviour).

It's useful for small icons/logos which are representative of an article, and which a user might click on expecting to be taken to that article.

Limitations

These are some things I have noticed while using this template. I'm not enough of an HTML guru to figure out why, let alone fix it.

  1. Apparently you can only have a max image size of 100 pixels for the thumbnail. This is probably due to the "line-height: 100px;" parameter in the template. I don't know enough about HTML to figure out what would happen if I were to change that parameter. Would it still work in all cases? Why not just use the "height" parameter there, rather than hardcode the line height? I dunno, I copied it from Wikipedia...
  2. It appears to work best with square thumbnail graphics. (Or possibly with graphics that are taller than they are wide.) I tired a 100px by 79px garphic, and the right side was not completely covered by the hotlink.

See also