Set document.title onAfterRun to Iron router:
var pageTitle = 'My super web'; Router.map(function() { this.route('user', { onAfterRun: function() { document.title = 'User ' + this.params.name + ' - ' + pageTitle; } }); });
EDIT
If you want to set the title in the template, create a special Handlebars helper (client code):
Handlebars.registerHelper("KAZOOM", function(title) { if(title) { document.title = title; } else { document.title = "Your default title"; } });
And use it in your templates as you used it
{{KAZOOM 'example page'}}
or
{{KAZOOM}}
for the default header.
EDIT July 26, 2015: for the new Iron Router, it will look like this:
Router.route('/user', { onAfterAction: function() { document.title = 'page title'; } });
source share