Iron-Router dynamic templates in layout like in Flow-Router


#1

Hello!
How can i render dynamic templates via layout in Iron Router?

For example in Flow-Router in layout i can define some dynamic templates:

newsRoutes.route('/',{
  action:function(){
    BlazeLayout.render("layout",{top:"digest",left:"post_list",right:"chat"});
  }
});

And then i can define another route with another parameters:

adminRoutes.route('/',{
  action:function(){
    BlazeLayout.render("admin_layout",{top:"admin_user_list"});
  }
});

And Flow-Router will not render nothing in left and right positions.And it is good for me.

But with named {{>yield}} regions in Iron:Router i can’t do that. Because Iron:Router save {{>yield}} regions from route to route, and it can be only rewriten by redefined regions. How can i prevent rendering {{>yield}} regions if it not defined in current route?