I have a header region where i like to have my navigation available in the initial markup (because of SEO)
<header id="header-region">
<ul id="menu">
<li>frontpage</li>
<li>about</li>
<li>contact</li>
<li>testing</li>
</ul>
</header>
Then i created a Marionette Layout View:
var MenuView = Backbone.Marionette.ItemView.extend({});
var menuView = new MenuView({
el: '#menu'
});
App.headerRegion.attachView(menuView);
This works flawless, but when i later change the headerRegion content
App.headerRegion.show(anotherView);
And then wanna switch back to the original mainView using
App.headerRegion.show(menuView);
It tries to render the menuView but because it has no "template" it fails, can i somehow reuse the same view instance without re-render it ? Or is the "Marionette way" of doing it to re-initialize a new menuView ? (im just curious if i have a rather complex view that needs to be swapped out quite alot, the view re-render each time could be quite expensive)