title: express-handlebars, render a hbs file without layout and with context
body: <p>I'm using express.js with express-handlebars and I want to render an .hbs file without the default layout but with some context.</p>
  
  <p>I can pass some context: </p>
  
  <pre><code>router.get('/catalog', function (req, res) {
      res.render('catalog/index.hbs', data);
  });
  </code></pre>
  
  <p>I can deactivate default layout: </p>
  
  <pre><code>router.get('/catalog', function (req, res) {
      res.render('catalog/index.hbs', {layout: false});
  });
  </code></pre>
  
  <p>but I can't do both at the same time: </p>
  
  <pre><code>router.get('/catalog', function (req, res) {
      res.render('catalog/index.hbs', data, {layout: false});
  });
  </code></pre>
  
  <p>(tried switching the parameterst too).</p>
  
  <p>On <a href="https://github.com/ericf/express-handlebars" rel="nofollow">express-handlebars docs</a> I can't find a way to do both, what am I missing?</p>
  
  <p>thank you.</p>
  
  <p>EDIT: well... it seems that the answer was there in the docs within an advance topic example, I can do the following: </p>
  
  <pre><code>router.get('/catalog', function (req, res) {
      res.render('catalog/index.hbs', {catalog: data, layout: false});
  });
  </code></pre>
  
  <p>So I can mix the data and the render options in the same object. </p>