【发布时间】:2017-03-27 03:44:22
【问题描述】:
我正在尝试在我们的 wiki 中设置一个页面,该页面涵盖了我们软件中特定运算符的某些参数。 软件中的每个参数都可以是特定类型,例如“菜单”或“切换”。
所以我想我会创建 2 个模板。第一个叫做“参数”,第二个叫做“菜单”。
参数模板如下所示:
'''{{{label}}}''' <code>{{{name}}}</code> - {{{summary}}}
{{{items}}}
菜单模板如下所示:
* {{{label}}} <code>{{{name}}}</code> - {{{summary}}}
我的页面内容如下所示:
{{Parameter
|type=menu
|label=Interpolation
|name=interp
|items=
{{
{{menu|name=nointerp|label=No Interpolation|summary=Use the value of the nearest sample.}}
|{{menu|name=linear|label=Linear|summary=Use linear interpolation between samples when the interval is lengthened. Averages all samples near the new sample when the interval is shortened.}}
|{{menu|name=cubic|label=Cubic|summary=Cubically interpolates between samples, for smoother curves than Linear. This method is not recommended for channels with sharp changes.}}
|{{menu|name=edge|label=Pulse Preserve|summary=A linear interpolation that recognizes single sample pulses and preserves their height and one sample width. A pulse is a non-zero value preceded and followed by zero-value samples.}}
}}
|summary=The interpolation method to use when resampling.}}
这几乎可行,但我得到了额外的字符,如“{”和“|”呈现在实际页面上。
我想我的问题是:是否可以像我这样做的方式将参数传递给“子模板”?
非常感谢
【问题讨论】:
-
不,您不能将参数传递给子模板,但这也不是您在这里所做的。您正在将模板作为参数传递给另一个模板。这很好,虽然你这里似乎有一堆不匹配的大括号。
-
谢谢。就是这样。我以为我需要传递参数,但调用其他模板是我实际在做的事情。
标签: mediawiki mediawiki-templates