You cannot use Meteor.call in the handlebars block with the paradigm above, primarily due to the asynchronous javascript design, by the time the value is received from the server, the return value has already been returned.
However, you can pass it using the Session variable:
Handlebars.registerHelper('get_handle', profileId, name, function() { return new Handlebars.SafeString(Session.get("get_handle" + profileId + "_" + name)); }); //In a meteor.startup or a template.render Meteor.call("getProfileLink", profileId, name, function(error, result) { if (error) { Session.set("get_handle" + profileId + "_" + name, '<a href="#">' + name + '</a>'); } else { Session.set("get_handle" + profileId + "_" + name, '<a href="http://twitter.com/' + result + '">' + name + '</a>'); } });
Also, be careful when trying to use to have so many Meteor.call for each profileId and name (if you use it in some list or something else) when you can request data in one bulk request.
Hacker way
You can still do it as you plan, but I would advise you to do it. I think this is a little inefficient.
Handlebars.registerHelper('get_handle', profileId, name, function() { if(Session.get("get_handle" + profileId + "_" + name)) { return new Handlebars.SafeString(Session.get("get_handle" + profileId + "_" + name)); } else { Meteor.call("getProfileLink", profileId, name, function(error, result) { if (error) { Session.set("get_handle" + profileId + "_" + name, '<a href="#">' + name + '</a>'); } else { Session.set("get_handle" + profileId + "_" + name, '<a href="http://twitter.com/' + result + '">' + name + '</a>'); } }); return "Loading..." } });
source share