Template:Calculator-hideifzero

Template documentation
Category:Templates using TemplateStyles

Usage

Allows showing or hiding page elements based on Calculator formula. This requires the Calculator gadget to work.

Example

{{calculator-hideifzero|formula=showtext|Some text that might be hidden if the checkbox is unchecked}}

{{calculator|type=checkbox|id=showtext|default=1}} {{calculator label|Show text|for=showtext}} 

Creates:

Some text that might be hidden if the checkbox is unchecked

Category:Pages using gadget Calculator

1Category:Pages using gadget Calculator Show text

Template data

Allow showing or hiding a page element based on a calculator formula

Template parameters

ParameterDescriptionTypeStatus
formulaformula

Calculator formula to decide whether or not to show

Stringrequired
texttext 1

Wikitext to show or hide

Contentrequired
blockblock

Whether to be a block (div) element or an inline (span) element

Booleanoptional
elementelement

Name of element to use (overrides block). For example, if you want to hide a list item, you would set this to li

Default
span
Example
li
Stringoptional
classclass

Additional css classes

Stringoptional
starthiddenstarthidden

Have the text start off being not shown

Booleanoptional
stylestyle

Additional CSS to add

Stringoptional
class-liveclass-live

Additional css classes to add only once gadget is active

Stringoptional
Category:Calculator templates
Category:Calculator templates Category:Pages using gadget Calculator Category:Pages using the JsonConfig extension Category:Templates using TemplateStyles