Template:Calculator-hideifzero
Appearance
| This template uses TemplateStyles: |
Usage
[edit]Allows showing or hiding page elements based on Calculator formula. This requires the Calculator gadget to work.
Example
[edit]{{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
1 Show text
Template data
[edit]Allow showing or hiding a page element based on a calculator formula
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| formula | formula | Calculator formula to decide whether or not to show | String | required |
| text | text 1 | Wikitext to show or hide | Content | required |
| block | block | Whether to be a block (div) element or an inline (span) element | Boolean | optional |
| element | element | Name of element to use (overrides block). For example, if you want to hide a list item, you would set this to li
| String | optional |
| class | class | Additional css classes | String | optional |
| starthidden | starthidden | Have the text start off being not shown | Boolean | optional |
| style | style | Additional CSS to add | String | optional |
| class-live | class-live | Additional css classes to add only once gadget is active | String | optional |