0

I'm trying to set up a page in our wiki which covers certain parameters of a specific operator in our software. Every parameter in the software can be of a certain type, like "Menu" or "Toggle".

So I thought I'll create 2 Templates. First is called "Parameter", second is called "Menu".

The Parameter template looks like this:

'''{{{label}}}''' <code>{{{name}}}</code> - {{{summary}}}

{{{items}}}

And the Menu template looks like this:

* {{{label}}} <code>{{{name}}}</code> - {{{summary}}}

The content for my page would look like this:

{{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.}}

This almost works but I get extra characters like "{" and "|" rendered on the actual page.

My Question I guess is: Is it possible to pass parameters to "sub-templates" the way that I am doing this?

Thank you very much

Markus Heckmann
  • 307
  • 1
  • 6
  • 2
    No, you can't pass parameters to sub-templates, but then that's not what you are doing here, either. You are passing a template as a parameter to another template. That is perfectly fine, although you seem to have a bunch of mismatched braces here. – Tgr Mar 27 '17 at 06:23
  • Thank you. That was exactly it. I thought I need to pass through parameters but calling other templates is what i'm actually doing. – Markus Heckmann Mar 27 '17 at 16:43

2 Answers2

0

As mentioned in the comments, there was a conceptual problem in the way I thought this worked. I don't need t pass parameters to sub templates but am calling another template with a passed parameter. The properly working version therefor looks like this (The items parameter is not enclosed in curley brackets):

{{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.}}
Markus Heckmann
  • 307
  • 1
  • 6
0

Note that this will result in the menus being passed as parameters items, 1, 2 and 3. I think what you want is passing them all as the items parameter, in which case you need to remove the outer | marks.

Tgr
  • 27,442
  • 12
  • 81
  • 118