The wiki is lacking in content. You can help by creating a new article. See the to do list for more ways you can help.

Difference between revisions of "Template:Imgcaption"

From Final Fantasy Wiki
Jump to navigationJump to search
(adding in "file" by default)
(making size optional)
 
Line 1: Line 1:
<includeonly><div class="thumb {{#switch: {{{align}}}|right = tright|left = tleft }}">
<includeonly><div class="thumb {{#switch: {{{align}}}|right = tright|left = tleft }}">
<div class="thumbinner" style="-moz-background clip:none;background: none !important; border: none !important;width: {{#if: {{{captionwidth|}}}|{{{captionwidth|}}}|{{{size|}}} }};">[[File:{{{image|}}}|{{{size|}}}]]
<div class="thumbinner" style="-moz-background clip:none;background: none !important; border: none !important;width: {{#if: {{{captionwidth|}}}|{{{captionwidth|}}}|{{{size|}}} }};">[[File:{{{image|}}}{{#if:{{{size|}}}|{{!}}{{{size}}}}}]]
<div class="thumbcaption" style="background: {{{color|#FCF395}}}; color:{{{txtcolor|black}}}; margin-top: 2px; border: 1px solid black; {{#switch: {{{captionalign }}}|right = text-align: right;|center = text-align: center; }}">{{{caption|}}}</div></div></div></includeonly>
<div class="thumbcaption" style="background: {{{color|#FCF395}}}; color:{{{txtcolor|black}}}; margin-top: 2px; border: 1px solid black; {{#switch: {{{captionalign }}}|right = text-align: right;|center = text-align: center; }}">{{{caption|}}}</div></div></div></includeonly>
<noinclude>{{doc}}
<noinclude>{{doc}}
[[Category:Formatting templates|{{PAGENAME}}]]
[[Category:Formatting templates|{{PAGENAME}}]]
</noinclude>
</noinclude>

Latest revision as of 17:33, March 29, 2021

Template documentation (for the above template, sometimes hidden or invisible)

Usage[edit]

This template allows you to add a caption to an image without creating a frame around it. Usage:

{{imgcaption
|image=        the image (without "File:" prefix)
|size=         the width of the image in pixels (optional)
|align=        alignment (optional)
|caption=      the caption
|captionalign= caption alignment relative to image (optional)
|captionwidth= the width of the caption (in pixels) (optional)
|color=        color of the caption box
|txtcolor=     color of the caption text
}}

Note that "captionwidth" should be greater than or equal to "size" when used, or the image may get cut off.

Example[edit]

FFVII Cloud icon.png
Pause menu icon of Cloud from Final Fantasy VII


{{imgcaption
|image=FFVII Cloud icon.png
|size=109px
|align=right
|caption=Pause menu icon of Cloud from ''Final Fantasy VII''
|captionalign=center
|captionwidth=175px
|color=yellow
|txtcolor=red
}}

Attribution[edit]

Original template is from WiKirby.



Visit Template:Imgcaption/doc to edit this text! (How does this work?)