[solved] How to get template name in tpl callback?


Hey all! This sd be an easy one :smile:
How can I get template name in onRendered callback?


This is not as easy as you hoped…


will get you the view name of the current template instance

The reason its not straight forward is that you never need to address a template by it’s name after it is instantiated - you would use the Template.instance() method, or in the template callbacks the this keyword, which is a shortcut to the template instance


Template.toolbar.onRendered(function () {

logs ‘Template.toolbar’


Works nice and simple. Thanks a lot)