2017-03-27 9 views
0

우리 소프트웨어에서 특정 연산자의 특정 매개 변수를 다루는 위키 페이지를 설정하려고합니다. 소프트웨어의 모든 매개 변수는 "메뉴"또는 "토글"과 같은 특정 유형일 수 있습니다.중첩 템플릿에 매개 변수 전달

그래서 저는 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.}} 

이것은 거의 작동하지만 "{"와 "|" 실제 페이지에 렌더링됩니다.

내 생각 엔 다음과 같습니다. 매개 변수를 "하위 템플릿"에 전달할 수 있습니까?

내가이 일을 생각하는 방식에서 개념적 문제가 발생했습니다, 당신에게 코멘트에서 언급 한 바와 같이

+2

아니요, 하위 템플릿에 매개 변수를 전달할 수는 없지만 여기에서 수행중인 것은 아닙니다. 템플릿을 매개 변수로 다른 템플릿에 전달하고 있습니다. 그것은 완벽하게 괜찮습니다. 여기에 짝이 맞지 않는 괄호가있는 것 같습니다. – Tgr

+0

고맙습니다. 그것이 바로 그 것이었다. 나는 매개 변수를 전달해야한다고 생각했지만 다른 템플릿을 호출하는 것은 내가 실제로하고있는 것입니다. –

답변

0

참고 전달되는. 당신이 원하는 것은 items 매개 변수로 모두 전달하는 것입니다.이 경우 외부 | 표시를 제거해야합니다.

0

대단히 감사합니다. 하위 템플릿에는 매개 변수를 전달할 필요가 없지만 매개 변수가 전달 된 다른 템플릿을 호출하고 있습니다. 이 같은 외모 이에 대한 적절 작업 버전 (항목 매개 변수가 컬리 괄호 안에 포함되지 않음) : items, 1, 23 매개 변수로이 메뉴를 초래할 것

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