模板:Calculator-hideifzero/doc
外观
| 文件:Codex icon book color-base.svg | This is a documentation subpage for 模板:Calculator-hideifzero. It contains usage information, categories and other content that is not part of the original 模板 page. |
| CSS | This template uses 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
1 Show text
Template data
Allow showing or hiding a page element based on a calculator formula
| 参数 | 描述 | 类型 | 状态 | |
|---|---|---|---|---|
| formula | formula | Calculator formula to decide whether or not to show | 字符串 | 必需 |
| text | text 1 | Wikitext to show or hide | 内容 | 必需 |
| block | block | Whether to be a block (div) element or an inline (span) element | 布尔 | 可选 |
| 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
| 字符串 | 可选 |
| class | class | Additional css classes | 字符串 | 可选 |
| starthidden | starthidden | Have the text start off being not shown | 布尔 | 可选 |
| style | style | Additional CSS to add | 字符串 | 可选 |
| class-live | class-live | Additional css classes to add only once gadget is active | 字符串 | 可选 |