We are using backbone/marionette to build a large application that is split up into many independent modules. The main application manages the header, menus, notifications and footers. It also instantiates the router of each module and passes to it the central region of the app page, so that the module can render itself.
We have a router in the main app that responds to the default url by initializing and showing the menus, etc. The menu routes to a module by adding a hash tag to the url. Each module's router watches for the appropriate hash and responds by showing its contents in the region it was given by the main app.
This all works fine until the user wants to bookmark (or simply refresh) the module page. When this happens the module router correctly responds to the url with the hash on it, but the main router doesn't get invoked to reinitialize the menus and footers, so the module renders itself on the full page (without any headers/footers).
I think that the main router should fire the default route before the module router fires its event. This isn't happening.
Does anyone have any idea how I should implement this? TIA.