[Solved] How do I know what template called a registered helper?

I need to know in which template a generic helper created with UI.registerHelper was called

It’s easy to access the template instance with Template.instance() but I haven’t found how to access the template object itself. The best I could do till now is to copy the template name in each template instance via an onCreated() function. And then call from the global helper Template[name]

So the question might be equivalent to “How do I find the template corresponding to a template instance ?”

Try Template.instance().view.name

1 Like

Actually Template.instance().view.template is even better because it gives you directly the template. So you don’t need to slice the name and call Template[name] or eval ('Template.name')

Thanks for the tip. I didn’t know where to look for it.