Template:Image frame: Difference between revisions

making width default to 200px broke pages that deliberately didn't specify a width in order to make the frame scale according to its content; fixing with parserfunctions
(Add pos parameter so other objects such as trees can use Template:Imageframe)
(making width default to 200px broke pages that deliberately didn't specify a width in order to make the frame scale according to its content; fixing with parserfunctions)
Line 1:
<includeonly>{{#ifeq:{{{align|right}}}|center|<div class="center">|}}
<div class="thumb {{#switch: {{{align|right}}} | right=tright | left=tleft | center=tnone | none=tnone |
tright}}"><div class="thumbinner" style="{{#if:{{{width|}}}|width:{{#expr:{{{width|200}}}+2}}px;}}">
{{#ifeq: {{{pos|bottom}}} | bottom |<div class="thumbimage" style="width{{#if:{{{width|200}}}|width:{{{width}}}px;}}">{{{content}}}</div>|}}
<div class="thumbcaption">{{#if: {{{link|}}} | <div class="magnify" style="float:right">{{{linkoverride|[[{{{link}}}|info]]}}}</div> |}}
{{{caption|}}}</div>
{{#ifeq: {{{pos|bottom}}} | top | <div class="thumbimage" style="width{{#if:{{{width|200}}}|width:{{{width}}}px;}}">{{{content}}}</div> |}}</div></div>
{{#ifeq:{{{align|right}}}|center|</div>|}}</includeonly><noinclude>
This template creates a frame like those surrounding images. This template can be used to put two or more images into a frame together, or as a wrapper for more complicated templates like {{tl|superimpose}}. Sample code for using this template is presented below.
Anonymous user