Template:Image frame: Difference between revisions
From Archon Arcana - The KeyForge Wiki
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
imported>Zven (Add pos parameter so other objects such as trees can use Template:Imageframe) |
imported>Ilmari Karonen (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: | Line 1: | ||
<includeonly>{{#ifeq:{{{align|right}}}|center|<div class="center">|}} | <includeonly>{{#ifeq:{{{align|right}}}|center|<div class="center">|}} | ||
<div class="thumb {{#switch: {{{align|right}}} | right=tright | left=tleft | center=tnone | none=tnone | | <div class="thumb {{#switch: {{{align|right}}} | right=tright | left=tleft | center=tnone | none=tnone | | ||
tright}}"><div class="thumbinner" style="width:{{#expr:{{{width | tright}}"><div class="thumbinner" style="{{#if:{{{width|}}}|width:{{#expr:{{{width}}}+2}}px;}}"> | ||
{{#ifeq: {{{pos|bottom}}} | bottom |<div class="thumbimage" style="width:{{{width | {{#ifeq: {{{pos|bottom}}} | bottom |<div class="thumbimage" style="{{#if:{{{width|}}}|width:{{{width}}}px;}}">{{{content}}}</div>|}} | ||
<div class="thumbcaption">{{#if: {{{link|}}} | <div class="magnify" style="float:right">{{{linkoverride|[[{{{link}}}|info]]}}}</div> |}} | <div class="thumbcaption">{{#if: {{{link|}}} | <div class="magnify" style="float:right">{{{linkoverride|[[{{{link}}}|info]]}}}</div> |}} | ||
{{{caption|}}}</div> | {{{caption|}}}</div> | ||
{{#ifeq: {{{pos|bottom}}} | top | <div class="thumbimage" style="width:{{{width | {{#ifeq: {{{pos|bottom}}} | top | <div class="thumbimage" style="{{#if:{{{width|}}}|width:{{{width}}}px;}}">{{{content}}}</div> |}}</div></div> | ||
{{#ifeq:{{{align|right}}}|center|</div>|}}</includeonly><noinclude> | {{#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. | 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. |