Template:CropImage: Difference between revisions

From A KoL Wiki
imported>Fig bucket
m change some parameter names, add an overlay parameter
imported>Fig bucket
m add an inline attribute
Line 1: Line 1:
<includeonly><div class="{{#ifeq:{{{location|}}}|center|center}}"><div style="width:{{{width}}}px;height:{{{height}}}px;overflow:hidden;position:relative"><div style="position:relative;top:-{{{top}}}px;left:-{{{left}}}px">[[File:{{{image}}}|{{{size}}}px|link={{{link|{{{image}}}}}}]]</div>{{#if:{{{overlay|}}}|<div style="position:absolute;top:{{#expr:{{{oTop}}}-{{{top}}}}}px;left:{{#expr:{{{oLeft}}}-{{{left}}}}}px;height:0px;">[[File:{{{overlay}}}]]</div>}}</div></div></includeonly><noinclude>
<includeonly><div class="{{#ifeq:{{{location|}}}|center|center}}" {{#if:{{{inline|}}}|style="display:inline-block;"}}><div style="width:{{{width}}}px;height:{{{height}}}px;overflow:hidden;position:relative"><div style="position:relative;top:-{{{top}}}px;left:-{{{left}}}px">[[File:{{{image}}}|{{{size}}}px|link={{{link|{{{image}}}}}}]]</div>{{#if:{{{overlay|}}}|<div style="position:absolute;top:{{#expr:{{{oTop}}}-{{{top}}}}}px;left:{{#expr:{{{oLeft}}}-{{{left}}}}}px;height:0px;">[[File:{{{overlay}}}]]</div>}}</div></div></includeonly><noinclude>


A template to make cropped images from a bigger image (mostly taken and stripped down from [[Wikipedia:Template:Css_Image_Crop|Wikipedia]]).
A template to make cropped images from a bigger image (mostly taken and stripped down from [[Wikipedia:Template:Css_Image_Crop|Wikipedia]]).
Line 12: Line 12:
*<code>left=</code> horizontal offset of cropping
*<code>left=</code> horizontal offset of cropping
*<code>link=</code> image link
*<code>link=</code> image link
*<code>inline=</code>1 if you want it inline-block style


You can also include an overlay image:
You can also include an overlay image:

Revision as of 17:53, 16 August 2014


A template to make cropped images from a bigger image (mostly taken and stripped down from Wikipedia).

Arguments:

  • image= original image
  • size= original image width
  • location=center for centering
  • width= cropped width
  • height= cropped height
  • top= vertical offset of cropping
  • left= horizontal offset of cropping
  • link= image link
  • inline=1 if you want it inline-block style

You can also include an overlay image:

  • overlay= overlay image
  • oTop= top of overlay image relative to the original image
  • oLeft= horizontal offset of overlay image relative to the original image