Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save copleykj/42ce83604a15c83b2d7f to your computer and use it in GitHub Desktop.
Save copleykj/42ce83604a15c83b2d7f to your computer and use it in GitHub Desktop.
Template.gem_view.context = function() {
return {
contentTemplate: "gems"
};
};
Template.page.render_content = function() {
var context = this;
var html = Template.no_template_found;
if (context && context.contentTemplate) {
if (typeof Template[context.contentTemplate] !== "undefined") {
html = Template[context.contentTemplate];
}
}
return html;
}
/* here is the template for the code above */
<template name="page">
{{{render_content context}}}
</template>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment