【发布时间】:2019-11-10 05:14:45
【问题描述】:
我得到了一个具有不同属性的 Mediawiki 表单。如果我有一个可选的文本字段,大部分时间都是空的。我的问题是,即使默认情况下我用空字符串填充我的文本字段,它也不会转移到模板并生成丑陋的伪像(缺少引用而不是空白字段)。
有什么方法可以确保字段转移到模板中?
摘自我的表格:
! Priority:
|{{{field|Priority|input type=category|default=High|top
category=Priority|height=85|hideroot=on}}}
|-
! Date:
| {{{field|Date|input type=datepicker|default= {{CURRENTYEAR}}/
{{CURRENTMONTH}}/{{CURRENTDAY}} }}}
! Comment:
|{{{field|Comment|input type=text|default=" "|height=85|hideroot=on}}}
|}
它生成模板:
{{Template
|Priority=High
|Date=01/01/1970
}}
但它不会生成:
{{Template
|Priority=High
|Date=01/01/1970
|Comment=
}}
我在模板中尝试了这个 if-check,但如果属性为 null,它会显示 {{{Comment}}}:
! [[Attribut:Comment| Comment]] | [[Comment::{{{Comment}}}
|{{#if:{{{Attribut:Comment}}}|{{{Comment}}}| }}]]
【问题讨论】: