Got next template in separate file section.htm:
<h3>${Name}</h3>
{{each Variables}}
{{tmpl($data) Type}}
${Type} | ${Name} | ${Value}
<br/>
{{/each}}
I need to render different templates (stored in htm files too) depending on Type.
For example, for Type equal to “MultilineText” – MultilineText.htm should be used.
Something like: {{tmpl($data) “MultilineText”}}
I already got MultilineText.htm loaded, compiled and cached.
Content of MultilineText.htm:
${Name}<textarea>${Value}</textarea>
But this code doesnt work 🙁
Please help.
Thanks.
And the answer is {{tmpl($value) $.template[$value.Type]}}
$.template[some_template_name] – with this u can choose what template will be rendered
some_template_name – name of template.
Notice that template should be loaded and compiled with $.tmpl before and have some_template_name name.