Setting up page title on meteor project


In config.js file(Placed inside lib folder), place this,setTitle function.

this.setTitle = function(title) {
  var base;
  base = ': Biomeds';
  window.scrollTo(0,0);
  if (title) {
    return document.title = title + ' | ' + base;
  } else {
    return base;
  }
};


Now in a normal route definition add this section

onAfterAction: function() {
      return setTitle('Login');
    }
eg:

Router.route('/', {
// layoutTemplate: 'left_panel',
path: '/',
onBeforeAction: function() {
this.render("login");
},

onAfterAction: function() {
      return setTitle('Login');
    }
});

Comments

Popular posts from this blog

Setting up Orthanc server on Ubuntu 16

How to install COMODO SSL Certificates for NGINX

HTML