Update This package just got mentioned in Meteor weekly 🙂 meteorhacks.com/meteor-weekly-meteor-new-version-10000-github-stars-dynamic-templates.html
Update This package is now BLAZE ready, the new render engine of meteor, therefor there are some syntax changes.
The view-manager package works like the Session object in meteor, but has some handy features. To place a template somewhere, just add the
{{DynamicTemplate placeholder="myKey" context=myData}}
helper somewhere and then call:
View.set('myKey','myTemplateName');
This will render template in its place. You can call
View.set('myKey',false);
to remove it. Additionally you can pass an object to give it data context e.g:
This context will then be merged with the context passed in template (dynamic content overwrites template set context)
View.set('myKey',{
template: 'myTemplateName'
context: {
...
}
});
Check out the package on atmosphere.