Template:Caption: Difference between revisions

From Zelda Dungeon Wiki
Jump to navigation Jump to search
Want an adless experience? Log in or Create an account.
m (simplified default visibility)
(Overriding the bootstrap breakage...)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<onlyinclude>{{#vardefine:CaptionID|{{#if:{{#varexists:CaptionID}}|{{#expr:{{#var:CaptionID}}+1}}|1}}}}
<onlyinclude>{{#vardefine:CaptionID|{{#if:{{#varexists:CaptionID}}|{{#expr:{{#var:CaptionID}}+1}}|1}}}}
{| border=1 style="{{Round|10}} border: 1px solid {{{bordercolor|#000000}}}; background: {{{borderbackground|#5a7eb5}}};"
{| border=1 style="border-collapse: separate; width: initial; {{Round|10}} border: 1px solid {{{bordercolor|#000000}}}; background: {{{borderbackground|#5a7eb5}}}; {{#switch: {{lc:{{{float|}}}}}|left=float: left; margin-right: 1em;|right=float: right; margin-left: 1em;|center=margin: auto;}}"
! class="cap{{#var:CaptionID}}col0 _toggler-cap{{#var:CaptionID}}col0 _toggler-cap{{#var:CaptionID}}col1 _toggler-cap{{#var:CaptionID}}col2" title="{{{titleshow|{{{title|}}}}}}" style="{{Round|10}} background: {{{buttonbackgroundshow|{{{buttonbackground|#f2f2f2}}}}}}; {{#ifeq: {{lc:{{{init|show}}}}}|hide||display: none;}}" |{{#if: {{{iconshow|{{{icon|}}}}}}
! class="cap{{#var:CaptionID}}col0 _toggler-cap{{#var:CaptionID}}col0 _toggler-cap{{#var:CaptionID}}col1 _toggler-cap{{#var:CaptionID}}col2" title="{{{titleshow|{{{title|}}}}}}" style="{{Round|10}} cursor: pointer; background: {{{buttonbackgroundshow|{{{buttonbackground|#f2f2f2}}}}}}; {{#ifeq: {{lc:{{{init|show}}}}}|hide||display: none;}}; padding:5px" |{{#if: {{{iconshow|{{{icon|}}}}}}
   | [[File:{{{iconshow|{{{icon}}}}}}|{{{sizeshow|{{{size|40px}}}}}}|link=]]
   | [[File:{{{iconshow|{{{icon}}}}}}|{{{sizeshow|{{{size|40px}}}}}}|link=]]
   | {{#tag:poem|{{{textshow|{{{text}}}}}}}}
   | {{#tag:poem|{{{textshow|{{{text}}}}}}}}
   }}
   }}
! class="cap{{#var:CaptionID}}col1 _toggler-cap{{#var:CaptionID}}col0 _toggler-cap{{#var:CaptionID}}col1 _toggler-cap{{#var:CaptionID}}col2" title="{{{titlehide|{{{title|}}}}}}" style="{{Round|left|10}}; background: {{{buttonbackgroundhide|{{{buttonbackground|#f2f2f2}}}}}}; {{#ifeq: {{lc:{{{init|show}}}}}|hide|display: none;|}}" |{{#if: {{{iconhide|{{{icon|}}}}}}
! class="cap{{#var:CaptionID}}col1 _toggler-cap{{#var:CaptionID}}col0 _toggler-cap{{#var:CaptionID}}col1 _toggler-cap{{#var:CaptionID}}col2" title="{{{titlehide|{{{title|}}}}}}" style="{{Round|left|10}}; cursor: pointer; background: {{{buttonbackgroundhide|{{{buttonbackground|#f2f2f2}}}}}}; {{#ifeq: {{lc:{{{init|show}}}}}|hide|display: none;|}}; padding:5px" |{{#if: {{{iconhide|{{{icon|}}}}}}
   | [[File:{{{iconhide|{{{icon}}}}}}|{{{sizehide|{{{size|40px}}}}}}|link=]]
   | [[File:{{{iconhide|{{{icon}}}}}}|{{{sizehide|{{{size|40px}}}}}}|link=]]
   | {{#tag:poem|{{{texthide|{{{text}}}}}}}}
   | {{#tag:poem|{{{texthide|{{{text}}}}}}}}
   }}
   }}
| class="cap{{#var:CaptionID}}col2" style="{{Round|right|10}} background: {{{contentbackground|#ffffff}}}; {{#ifeq: {{lc:{{{init|show}}}}}|hide|display: none;|}}" | {{#tag:poem|{{{1}}}}}
| class="cap{{#var:CaptionID}}col2" style="{{Round|right|10}} background: {{{contentbackground|#ffffff}}}; {{#ifeq: {{lc:{{{init|show}}}}}|hide|display: none;|}}; padding:5px" | {{#tag:poem|{{{1}}}}}
|}</onlyinclude>
|}</onlyinclude>


Line 43: Line 43:
{{Clear}}
{{Clear}}


The caption can be hidden by default using <code>init=hide</code>
The caption can be hidden by default using <code>init=hide</code>, and it can be floated left, center, or right using <code>float=left</code>, etc.


==Icons==
==Icons==

Latest revision as of 01:36, March 17, 2021

{{{text}}}

{{{1}}}

Purpose

This template is the base for creating captions that, for example, can be used to contain certain character quotes about a page's subject.

Usage

To use this template, start with this code:

{{Caption|content
| icon = 
| text = 
| title = 
| size = 
| buttonbackground = 
| contentbackground = 
| bordercolor = 
| borderbackground = 
}}


  • content — The caption itself, which can be hidden by clicking the button.
  • icon — The name of an image to display as the 'toggle visibility' button. Use this OR "text".
  • text — The text to display as the 'toggle visibility' button. Use this OR "icon".
  • title — Text to appear as a tooltip when hovering over the button. (Optional.)
  • size — If the button is an image, this will define the width of the image. (Optional. Default: 40px)
  • buttonbackground — Background color for the button. (Optional. Default: #f2f2f2)
  • contentbackground — Background color for the content. (Optional. Default: #ffffff)
  • bordercolor — Color of the edges of the border. (Optional. Default: #000000)
  • borderbackground — Center color of the border. (Optional. Default: #5a7eb5)

The 'show' button can be defined independently of the 'hide' button by using "iconhide" and "iconshow" instead of "icon", as with "text", "title", "size", and "buttonbackground":

{{Caption|content
| iconhide = 
| iconshow = 
| texthide = 
| textshow = 
| titlehide = 
| titleshow = 
| sizehide = 
| sizeshow = 
| buttonbackgroundhide = 
| buttonbackgroundshow = 
| contentbackground = 
| bordercolor = 
| borderbackground = 
}}


  • iconhide — Filename for the 'hide' button.
  • iconshow — Filename for the 'show' button.
  • texthide — Text for the 'hide' button.
  • textshow — Text for the 'show' button.
  • titlehide — Tooltip for the 'hide' button. (Optional.)
  • titleshow — Tooltip for the 'show' button. (Optional.)
  • sizehide — Size of the 'hide' button's image. (Optional. Default: 40px)
  • sizeshow — Size of the 'show' button's image. (Optional. Default: 40px)
  • buttonbackgroundhide — Background color for the 'hide' button. (Optional. Default: #f2f2f2)
  • buttonbackgroundshow — Background color for the 'show' button. (Optional. Default: #f2f2f2)

The caption can be hidden by default using init=hide, and it can be floated left, center, or right using float=left, etc.

Icons

Old Man (template)
OldManIcon.png
OldManIcon.png
Navi (template)
NaviIcon.png
NaviIcon.png
Tatl (template)
TatlIcon.png
TatlIcon.png
Fi (template)
FiIcon.png
FiIcon.png