• Home
  • Random
  • Nearby
  • Log in
  • Settings
Donate Now If Wikipedia is useful to you, please give today.
  • About Wikipedia
  • Disclaimers
Wikipedia

Template:Calculator-hideifzero/sandbox

  • Template
  • Talk
  • Language
  • Watch
  • Edit
< Template:Calculator-hideifzero
This is the template sandbox page for Template:Calculator-hideifzero (diff).
Template documentation[view] [edit] [history] [purge]
CSSThis template uses TemplateStyles:
  • Template:Calculator-hideifzero/sandbox/styles.css

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

Template parameters[Edit template data]

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
The above documentation is transcluded from Template:Calculator-hideifzero/doc. (edit | history)
Editors can experiment in this template's sandbox (edit | diff) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:Calculator-hideifzero/sandbox&oldid=1262081493"
Last edited on 9 December 2024, at 14:23

Languages

      This page is not available in other languages.

      Wikipedia
      • Wikimedia Foundation
      • Powered by MediaWiki
      • This page was last edited on 9 December 2024, at 14:23 (UTC).
      • Content is available under CC BY-SA 4.0 unless otherwise noted.
      • Privacy policy
      • About Wikipedia
      • Disclaimers
      • Contact Wikipedia
      • Code of Conduct
      • Developers
      • Statistics
      • Cookie statement
      • Terms of Use
      • Desktop