I often find that I am sharing my work with templates that the same helpers can still use.
So, let's say I have this template structure:
<template name="MainTemplate"> <div>{{> FirstTemplate}}</div> <div>{{> SecondTemplate}}</div> <div>{{> ThirdTemplate}}</div> <div>{{> FourthTemplate}}</div> </template>
Now each of these templates wants to use the same helper, let him call it dataHelper :
Template.MainTemplate.helpers({ dataHelper: function() { //do some stuff return result } })
Unfortunately, this helper cannot be accessed in the first through fourth template, simply by typing {{dataHelper}} , how the events work.
My solution was to create a global helper, but that seems a bit overkill, especially since I have a few pages that don't care about these helpers at all. Another solution is to create four separate helpers, but, hey, DRY.
Did I miss something simple here?
Yeats source share