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:{{{ | |||
<div style="position:relative;top:-{{{ | |||
[[File:{{{image}}}|{{{ | |||
</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> | *<code>size=</code> original image width | ||
*<code>location=</code>''center'' for centering | *<code>location=</code>''center'' for centering | ||
*<code> | *<code>width=</code> cropped width | ||
*<code> | *<code>height=</code> cropped height | ||
*<code> | *<code>top=</code> vertical offset of cropping | ||
*<code> | *<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 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