Well, if you want to do this Meteor Path, there are two main options, and you need to decide which one works best:
a. you can insert the template you want to use into the placeholder using UI.insert and UI.render (or UI.renderWithData if you need data for visualization, for example:
UI.insert(UI.render(Template.name), document.body) UI.insert(UI.renderWithData(Template.foo, {bar: "baz"}), document.body)
b: you can use session-based conditions in your template and order it only if a specific session is established, for example:
<template name="signInForm"> <div class="signUp"> click me to make the sign up form appear</div> <div class="container"> {{#with userPressedSignUp}} <form class="form-signin" role="form" id="signUpForm"> .. form elements.. </form> {{/with} </template> Template.signInForm.userPressedSignUp = -> return Session.get 'signUp-visible" Template.signInForm.events 'click .signUp': (event) -> Session.set 'signUp-visible', true Session.set 'signUp_visible', false # The template will not show the contents of the "with" as long as the session # variable is 'false', change it by clicking on "signUp" div when you want the form to appear
source share