Modified the template switching system to use a plugin controller (in layout.js) which passes the correct template name and View Model context to ko.renderTemplate().