If you want the navigation to be automatically rebuilt when the contentWindow displays as suggested by Hubert OG, you can also use a cleaner and lower level of context invalidation:
var navDep = new Deps.Dependency; Template.contentWindow.rendered = function() { ... navDep.changed(); } Template.renderNav.contentData = function() { navDep.depend();
See http://docs.meteor.com/#deps for more details.
If, on the other hand, you want to display another template manually, you can name it as a function:
var html = Template.contentWindow();
The returned html will not respond. If you need reactivity, use:
var reactiveFragment = Meteor.render(Template.contentWindow);
For detailed information on how this works, see screencasts at http://www.eventedmind.com/ about Sparks and reactivity.
UPDATE
To add an edited snippet to your DOM:
document.body.appendChild(Meteor.render(function () { return '<h1>hello</h1><b>hello world</b>'; }));
You can also directly access the displayed nodes using the DOM API:
console.log(reactiveFragment.childNodes[0]);
source share