title: Include handlebars partial dynamically
body: <p>I have 4 files: main.hbs, partial1.hbs, partial2.hbs, app.js</p>
  
  <p>in partial1.hbs</p>
  
  <pre><code>{{#partial 'test'}}
      THIS IS TEST
  {{/partial}}
  </code></pre>
  
  <p>in partial2.hbs</p>
  
  <pre><code>{{#partial 'hello'}}
  THIS IS HELLO
  {{/partial}}
  </code></pre>
  
  <p>in main.hbs</p>
  
  <pre><code>{{#block 'test'}}this is a placeholder{{/block}}
  {{#block 'hello'}}this is also a placeholder{{/block}}
  </code></pre>
  
  <p>in app.js</p>
  
  <pre><code>'use strict';
  var express = require('express'),
        app = express(),
        path = require('path');
  
  
  //adding handlebars
  var exphbs  = require('express3-handlebars');
  var helpers = require('../handlebarsHelpers');
  var Handlebars = require('handlebars');
  
  app.engine('.hbs', exphbs({defaultLayout: 'main', 
                              helpers: helpers,
                              precompiled: ['views/partials'],
                              extname: '.hbs', partialsDir: ['views/partials']}));
  
  app.set('view engine', '.hbs');
  
  function loadPartial(name){
  var partial = Handlebars.partials[name];
      if(typeof partial === "string"){
          partial = Handlebars.compile(partial);
          Handlebars.partials[name] = partial;
      }
      return partial;
  };
  
  Handlebars.registerHelper("block", function(name, options){
      var partial = loadPartial(name) || options.fn;
      return partial(this, { data:options.hash });
  });
  
  Handlebars.registerHelper("partial", function(name, options){
      Handlebars.registerPartial(name, options.fn);
  });
  
  app.get('/', function (req, res) {
      res.render('main');
  });
  
  app.use(express.static(path.join(__dirname, '../public')));
  
  module.exports = app;
  </code></pre>
  
  <p>Issues:
  I’m not able to replace the block on main.hbs by the appropriate partial block. Can you guys help?</p>
  
  <p>P.S: I don’t want to use {{> partialName}} to include the partial but instead have something like a json and then render dynamically the block.</p>