Open boustanihani opened 9 years ago
Hey @boustanihani, you need to explicitly say this.renderRegions
if you want to render the regions from your options. This happens automatically if you use this.render() // no template name
.
Don't you think this should also be the default behaviour when passing a template name?
Take the following example from the docs: http://eventedmind.github.io/iron-router/#using-hooks
You would like to render the 'Login' template on specific routes if the user is not logged. Naturally you would also want the whole template with all regions to be rendered:
Router.onBeforeAction(function () {
// all properties available in the route function
// are also available here such as this.params
if (!Meteor.user()) {
// if the user is not logged in, render the Login template
this.render('Login');
} else {
// otherwise don't hold up the rest of hooks or our route/action function
from running
this.next();
}
});
How about adding the option { renderRegions : false }
to render()
for further needs ?
We could update the API. Going to move this to brainstorming so we can continue discussion there.
I am using iron:router@=1.0.0-rc.1
Regions are missing when using
this.render('templatename')
inside a route!For reproduction goto http://missing-regions.meteor.com/ then click Page 2 and notice how the content of Region 1 will disappear.
Repo: https://github.com/boustanihani/missing-regions