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 imagesize=
original image widthlocation=
center for centeringwidth=
cropped widthheight=
cropped heighttop=
vertical offset of croppingleft=
horizontal offset of croppinglink=
image linkinline=
1 if you want it inline-block style
You can also include an overlay image:
overlay=
overlay imageoTop=
top of overlay image relative to the original imageoLeft=
horizontal offset of overlay image relative to the original image