模板:Calculator-hideifzero:修订间差异
外观
wiki>Bawolff 小 6 revisions imported from w:en:Template:Calculator-hideifzero: Importing calculator related template to use with Global gadgets system |
小 导入1个版本 |
(没有差异)
| |
2025年12月16日 (二) 16:40的最新版本
| 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 | 字符串 | 可选 |