Here is the solution I found on an Ember.js discussion forum:
To achieve two different layouts, create two views with the "layoutName" property specified:
App.MainLayoutView = Ember.View.extend({ layoutName: 'layout/main', });
and:
App.SecondaryLayoutView = Ember.View.extend({
layoutName: 'layout/secondary',
});
Create templates for each layout named "layout/main" and "layout/secondary".
Ensure that your views extend these layout views. For example, consider the following route configuration:
App.Router.map(function() {
this.resource('users', function() {
this.route('new');
this.route('login');
});
});
If you want the users route to use MainLayout and the login route to use Secondary layout, define two views:
App.ProjectsView = App.MainLayoutView.extend();
and
App.LoginView = App.SecondaryLayoutView.extend();
No need to create a view for "projects/new" as it is a nested route of projects and inherits the Projects layout.
I hope this explanation helps!