Mediawiki 将参数传递给嵌套模板

Mediawiki 将参数传递给嵌套模板,mediawiki,mediawiki-templates,Mediawiki,Mediawiki Templates,我试图在我们的wiki中设置一个页面,其中包含软件中特定操作员的某些参数。 软件中的每个参数都可以是特定的类型,如“菜单”或“切换” 所以我想我将创建两个模板。第一个称为“参数”,第二个称为“菜单” 参数模板如下所示: '''{{{label}}}''' <code>{{{name}}}</code> - {{{summary}}} {{{items}}} * {{{label}}} <code>{{{name}}}</code> - {{{s

我试图在我们的wiki中设置一个页面,其中包含软件中特定操作员的某些参数。 软件中的每个参数都可以是特定的类型,如“菜单”或“切换”

所以我想我将创建两个模板。第一个称为“参数”,第二个称为“菜单”

参数模板如下所示:

'''{{{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.}}
菜单模板如下所示:

'''{{{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.}}
我的页面内容如下所示:

'''{{{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.}}
这几乎可以正常工作,但我在实际页面上呈现了额外的字符,如“{”和“|”

我想我的问题是:是否可以像我这样将参数传递给“子模板”


非常感谢

正如我在评论中提到的,我认为这是一个概念上的问题。 我不需要将参数传递给子模板,而是使用传递的参数调用另一个模板。 因此,正确工作的版本如下所示(items参数未包含在花括号中):


请注意,这将导致菜单作为参数
1
2
3
传递。我认为您需要将它们全部作为
参数传递,在这种情况下,您需要删除外部的
标记。

不,您不能将参数传递给子模板,但随后at也不是你在这里要做的。你正在将一个模板作为参数传递给另一个模板。这很好,尽管这里有一堆不匹配的大括号。谢谢。正是这样。我想我需要传递参数,但调用其他模板才是我真正要做的。