I\'m trying to build a smart package for Meteor app that provides some monitoring capabilities and other tools based on the features of the smart package. For more details read
IronRouter supports multiple layouts.
https://github.com/EventedMind/iron-router
Router.configure({
layout: 'layout',
notFoundTemplate: 'notFound',
loadingTemplate: 'loading',
renderTemplates: {
/* render the templated named footer to the 'footer' yield */
'footer': { to: 'footer' },
/* render the template named sidebar to the 'sidebar' yield */
'header': { to: 'header' }
}
});
Router.map(function() {
this.route('admin', {
layout: 'admin_layout',
path: '/admin',
template: 'admin',
data: function() {
return { page : 'admin'}
},
onBeforeRun: checkLoggedIn,
renderTemplates: {
/* render the template named footer to the 'footer' yield */
'admin_footer': {to: 'footer'},
/* render the template named sidebar to the 'sidebar' yield */
'admin_login_header': {to: 'header'}
}
});
this.route('home', {
path: '/',
template: 'home',
data: function() {
return { page : 'home'}
}
});
//this is where your standard view layout goes
//this is where your admin view layout goes
Could work pretty well if you match it up with Meteor accounts UserID checks and onBeforeRun hooks. I haven't fully tested the security aspect but it looks like it will work.