Template:Image frame: Difference between revisions

1,719 bytes removed ,  2 years ago
m
43 revisions imported from templatewiki:Template:Image_frame
(extra colon to actually allow linking of images)
m (43 revisions imported from templatewiki:Template:Image_frame)
 
(23 intermediate revisions by 18 users not shown)
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 noresize" style="{{#if:{{{width|}}}|width:{{#expr:{{{width}}}+2}}px;}}">{{#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|[[File:Desc-i.svg|16px|link={{{link}}}]]}}}</div> |}}{{{caption|}}}</div>{{#ifeq: {{{pos|bottom}}} | top | <div class="thumbimage" style="{{#if:{{{width|}}}|width:{{{width}}}px;}}">{{{content}}}</div> |}}</div></div>{{#ifeq:{{{align|right}}}|center|</div>|}}</includeonly><noinclude>{{Documentation}}{{En-WP attribution notice|Template:Image frame}}</noinclude>
<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}}}+2}}px;}}">
{{#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> |}}
{{{caption|}}}</div>
{{#ifeq: {{{pos|bottom}}} | top | <div class="thumbimage" style="{{#if:{{{width|}}}|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.
<pre width=100%>
{{Imageframe|width=|content=|caption=|link=|align=|pos=}}
</pre>
 
== Parameters ==
;Required
*'''width''': the width of the image within the frame, in pixels (though do not add "px" to the width: ie, use width=175 and not width=175px)
*'''content''': content of the main section (generally images)
 
;Optional
*'''caption''': content of the caption section
*'''link''': link for the "Enlarge" link in the caption (in the future, may also be used as the link for the image field inside the frame, though it would probably require an additional ''height'' parameter)
*'''linkoverride''': allows anything to be used instead of the 'info' link
*'''align''': Valid values: right ''(default)'', left, center.
*'''pos''': Valid values: top, bottom ''(default)''
==Example==
By filling out the parameters as follows, the result will be as shown below the code.
<pre width=100%>
{{Imageframe|width=200|content=[[Image:Example.png|100px]][[Image:Example.png|100px]]|caption=Example usage|link=Hello world|align=center}}
</pre>
{{Imageframe|width=200|content=[[Image:Example.png|100px]][[Image:Example.png|100px]]|caption=Example usage|link=Hello world|align=center}}
 
<pre width=100%>
{{Imageframe|width=200|content=[[Image:Example.png|100px]][[Image:Example.png|100px]]|caption=Example usage|link=Hello world|align=center|pos=top}}
</pre>
{{Imageframe|width=200|content=[[Image:Example.png|100px]][[Image:Example.png|100px]]|caption=Example usage|link=Hello world|align=center|pos=top}}
 
[[Category:Formatting templates|{{PAGENAME}}]]
</noinclude>