Pass template as parameter


Is there a way to pass template as parameter ?
something like this:


<template name="custom_UI">
        {{> {{primary_element}} }}
        some content
              {{> {{panel_template}} }}
              some content

and then use it like this

{{> custom_UI primary_element="button_0" panel_template="panel_0"}}
{{> custom_UI primary_element="button_1" panel_template="panel_1"}}

<template name="button_0">some content</template>
<template name="panel_0">some content</template>

<template name="button_1">some content</template>
<template name="panel_1">some content</template>


I think you’re looking for dynamic templates.


even with dynamic template it did not work the main issue is how to pass template instance not string with the name of the template or how to create instance of template by it’s name.