Template:CropImage: Difference between revisions

From A KoL Wiki
imported>Fig bucket
seems to work, at least in simple tests...
 
imported>Fig bucket
m actually, make that more flexible
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly><div class="{{#ifeq: {{{location}}} | center |center">
<includeonly><div class="{{#ifeq:{{{location|}}}|center|center}}" {{#if:{{{style|}}}|style="{{{style|}}}"}}><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>
<div style="width:{{{cWidth}}}px;height:{{{cHeight}}}px;overflow:hidden;position:relative">
<div style="position:relative;top:-{{{oTop}}}px;left:-{{{oLeft}}}px">
[[File:{{{image}}}|{{{bSize}}}px|link={{{link|{{{image}}}}}}]]
</div>{{#ifeq: {{{location}}} | center |</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 10: Line 5:
Arguments:
Arguments:
*<code>image=</code> original image
*<code>image=</code> original image
*<code>bSize=</code> original image width
*<code>size=</code> original image width
*<code>location=</code>''center'' for centering
*<code>location=</code>''center'' for centering
*<code>cWidth=</code> cropped width
*<code>width=</code> cropped width
*<code>cHeight=</code> cropped height
*<code>height=</code> cropped height
*<code>oTop=</code> vertical offset of cropping
*<code>top=</code> vertical offset of cropping
*<code>oLeft=</code> horizontal offset of cropping
*<code>left=</code> horizontal offset of cropping
*<code>link=</code> image link
*<code>link=</code> image link
*<code>style=</code> if you want to add CSS stylings to the outermost div
You can also include an overlay image:
*<code>overlay=</code> overlay image
*<code>oTop=</code> top of overlay image relative to the original image
*<code>oLeft=</code> horizontal offset of overlay image relative to the original image


[[Category:Standardization Templates|{{PAGENAME}}]]</noinclude>
[[Category:Standardization Templates|{{PAGENAME}}]]</noinclude>

Latest revision as of 18:02, 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
  • style= if you want to add CSS stylings to the outermost div

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