title: Multiple layouts with Handlebars and ExpressJS?
body: <p>If I'm using Handlebars as my templating engine with Express 4, it seems like there is only the option to specify a single layout template to use for all your views:</p>
  
  <pre><code>app.engine('hbs', expressHbs({extname:'hbs', defaultLayout:'layout.hbs'}));
  </code></pre>
  
  <p>What if your app needs multiple layouts? What if <code>viewA.hbs</code> uses one layout and <code>viewB.hbs</code> needs a different layout?</p>
  
  <p>As I'm learning nodejs, I'm coming from a PHP Laravel background where the <a href="http://laravel.com/docs/5.0/templates#blade-templating" rel="noreferrer">Blade templating engine</a> has you specify which layout to use at the top of each view file. It makes it really simple to switch between layout templates for any given view.</p>