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 actually, make that more flexible |
||
(One intermediate revision by the same user not shown) | |||
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:{{{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> | ||
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>style=</code> if you want to add CSS stylings to the outermost div | |||
You can also include an overlay image: | You can also include an overlay image: |
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 imagesize=
original image widthlocation=
center for centeringwidth=
cropped widthheight=
cropped heighttop=
vertical offset of croppingleft=
horizontal offset of croppinglink=
image linkstyle=
if you want to add CSS stylings to the outermost div
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