Difference between revisions of "Template:Frame"

From Peter
Jump to: navigation, search
(improved documentation)
Line 1: Line 1:
 
<includeonly><table style="border:{{{borderstyle|.5em solid {{{border|#e5e5e5}}}}}}; {{roundy|{{{radius|.9em}}}}}; background-color:{{{background|#e5e5e5}}}; width:auto; margin:0 {{{margin|0}}};"><tr><td>{{{1|}}}</td></tr></table></includeonly><noinclude>
 
<includeonly><table style="border:{{{borderstyle|.5em solid {{{border|#e5e5e5}}}}}}; {{roundy|{{{radius|.9em}}}}}; background-color:{{{background|#e5e5e5}}}; width:auto; margin:0 {{{margin|0}}};"><tr><td>{{{1|}}}</td></tr></table></includeonly><noinclude>
 +
 +
==Usage==
 
This template will put a rounded frame (like the one used for thumbnails) around whatever you specify.
 
This template will put a rounded frame (like the one used for thumbnails) around whatever you specify.
  
==Syntax==
+
<pre>{{frame|content|border|background|margin}}</pre>
<nowiki>{{</nowiki> '''frame | text <nowiki><br> [[File:something.jpg|200px]]</nowiki>''' or '''<nowiki><youtube>WV_aWXeT</youtube></nowiki>''' | '''border=purple''' | '''background=purple''' <nowiki>}}</nowiki>
+
 
 +
{| class="wikitable"
 +
|content
 +
|The content to go inside the frame. This may be text, images or videos. See below for examples.
 +
|-
 +
|border
 +
|Border color. The default is border=purple.
 +
|-
 +
|background
 +
|Background color. The default is background=#e5e5e5.
 +
|-
 +
|margin
 +
|The frame's horizontal margin. To center the frame without the <nowiki><center></nowiki> tag use margin=auto. The default is margin=0.
 +
|}
 +
 
 +
=== Examples ===
 +
 
 +
;Simple
  
Be sure to remove whitespaces before saving the article.
+
<pre>{{frame|[[File:Lolwutpear.jpg|200px]]}}</pre>
  
==Examples==
+
;With a title
  
<nowiki>{{frame|'''LOL WUT'''<br>[[File:Lolwutpear.jpg|400px]]|border=red|background=red}}</nowiki>
+
<pre>{{frame|'''LOL WUT'''<br>[[File:Lolwutpear.jpg|200px]]}}</pre>
produces:
 
{{frame|<center><big>'''LOL WUT'''</big></center><br>[[Image:Lolwutpear.jpg|400px]]|border=red|background=red}}
 
  
<nowiki>{{frame|'''8-Bit Rick Roll'''<br><youtube>b1WWpKEPdT4</youtube>|border=blue|background=blue}}</nowiki>
+
;Specify border and background
produces:
 
{{frame|<big>'''8-Bit Rick Roll'''</big><br><youtube>b1WWpKEPdT4</youtube>|border=blue|background=blue}}
 
  
<nowiki>{{frame|[[Image:Lolwutpear.jpg|300px]]|border=red|background=red|margin=auto}}</nowiki>
+
<pre>{{frame|[[File:Lolwutpear.jpg|200px]]|border=red|background=black}}</pre>
produces:
+
 
{{frame|[[Image:Lolwutpear.jpg|300px]]|border=red|background=red|margin=auto}}
+
;Specify margin to center
 +
 
 +
<pre>{{frame|[[File:Lolwutpear.jpg|200px]]|margin=auto}}</pre>
 +
 
 +
;YouTube video
 +
 
 +
<pre>{{frame|<big>'''8-Bit Rick Roll'''</big><br><youtube>b1WWpKEPdT4</youtube>}}</pre>
 +
 
 +
== Output ==
 +
 
 +
{| class="wikitable" width="100%"
 +
|-
 +
!Simple
 +
!With a title
 +
!Specify border and background
 +
|-
 +
|{{frame|[[File:Lolwutpear.jpg|200px]]}}
 +
|{{frame|'''LOL WUT'''<br>[[File:Lolwutpear.jpg|200px]]}}
 +
|{{frame|[[File:Lolwutpear.jpg|200px]]|border=red|background=black}}
 +
|-
 +
! colspan="3" | Specify margin to center
 +
|-
 +
| colspan="3" | {{frame|[[File:Lolwutpear.jpg|200px]]|margin=auto}}
 +
|-
 +
! colspan="3" | YouTube video
 +
|-
 +
| colspan="3" | {{frame|<big>'''8-Bit Rick Roll'''</big><br><youtube>b1WWpKEPdT4</youtube>}}
 +
|}
  
 
==See also==
 
==See also==
 +
 
* {{Template|videoframe}} - for multiple [[YouTube]] videos in one box.
 
* {{Template|videoframe}} - for multiple [[YouTube]] videos in one box.
  
 
[[Category:Formatting Templates|{{PAGENAME}}]]
 
[[Category:Formatting Templates|{{PAGENAME}}]]
 
</noinclude>
 
</noinclude>

Revision as of 02:04, 11 December 2013


Usage

This template will put a rounded frame (like the one used for thumbnails) around whatever you specify.

{{frame|content|border|background|margin}}
content The content to go inside the frame. This may be text, images or videos. See below for examples.
border Border color. The default is border=purple.
background Background color. The default is background=#e5e5e5.
margin The frame's horizontal margin. To center the frame without the <center> tag use margin=auto. The default is margin=0.

Examples

Simple
{{frame|[[File:Lolwutpear.jpg|200px]]}}
With a title
{{frame|'''LOL WUT'''<br>[[File:Lolwutpear.jpg|200px]]}}
Specify border and background
{{frame|[[File:Lolwutpear.jpg|200px]]|border=red|background=black}}
Specify margin to center
{{frame|[[File:Lolwutpear.jpg|200px]]|margin=auto}}
YouTube video
{{frame|<big>'''8-Bit Rick Roll'''</big><br><youtube>b1WWpKEPdT4</youtube>}}

Output

Simple With a title Specify border and background
200px
LOL WUT
200px
200px
Specify margin to center
200px
YouTube video
8-Bit Rick Roll
<youtube>b1WWpKEPdT4</youtube>

See also