Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9206003
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:05:03+00:00 2026-06-18T00:05:03+00:00

I have an application that I want to create using Backbone Marionette. Basically, it’s

  • 0

I have an application that I want to create using Backbone Marionette. Basically, it’s UI structure is very simple. There are:

  • Two top level regions, one for the menu, the other for the content
  • The menu region shows a menu view
  • The content region shows two views next to each other
    • The left one is for a sub-navigation
    • The right one is for the actual content

As an example, the menu might switch between two parts of the application, such as “mail”, “calendar” and “contacts”. Each of those parts has its own sub-navigation which shall be shown in sub-navigation view, and each part has a default view. E.g., in the “mail” part this may be the “inbox” view, in the “calendar” part this may be the “month” view.

So, generally, we have a nested navigation.

How do I implement this using routers?

My idea is to have an application-level router that just provides routes for the parts such as #mail and #calendar.

The sub-navigation views then should have their own routers. So, e.g., the mail sub-navigation view could have a router for inbox and sent.

In the end I want to have a route such as #mail/inbox, but the first part should be handled by the top-level router, the second part should be handled by the sub-level router.

My question is whether I can nest routers in a way that the sub-level routers do not need to know the URL prefix such as “mail”, and there is a cascading routing happening. Is this possible?

Or is this approach completely wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T00:05:04+00:00Added an answer on June 18, 2026 at 12:05 am

    I don’t know if Marionette has a solution for this, but there’s a plugin called Backbone.subroute, which provides the kind of functionality you’re looking for.

    Separating sub-routes in this way is a legitimate pattern, and I’ve used it previously. However, I’ve since come to the conclusion that having each section’s “main” route in the main application router was not the way to go, because it separates concerns that should live together. Instead I’ve started implementing a common base class for routers, which provides for a “root” URL:

    var BaseRouter = Backbone.Router.extend({
    
        //Root path for all routes defined by this router. Override this in a deriving
        //class for keeping route table DRY.
        urlRoot: undefined,
    
        //override the route method to prefix the route URL
        route: function(route, name, callback) {
          if(this.urlRoot) {
            route = (route === '' ? this.urlRoot : this.urlRoot + "/" + route);
          }
    
          //define route
          Backbone.Router.prototype.route.call(this, route, name, callback);
    
          //also support URLs with trailing slashes
          Backbone.Router.prototype.route.call(this, route + "/", name, callback);
        }
    });
    

    Usage:

    var CalendarRouter = BaseRouter.extend({
        //all routes will be relative to "calendar"
        urlRoot:"calendar",
        routes: {
            //...
        }
    }): 
    

    Granted, for my case this makes sense also because I define other common router tasks in the base class. Just to avoid typing the extra “calendar” prefix for each route url doesn’t really warrant it.

    Edit: Just to clarify, the Backbone.SubRoute plugin doesn’t force you to define the root route in the main router, you can use it in the same way as the base class I suggested. But if all you want is a route prefix, then the base class is a lighter, simpler solution.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a still pretty simple Rails application that I want to develop using
We have an application that we want to make available to the general internet-using
There are people that are writing Backbone applications using a Backbone.d.ts. There are two
I want to create a simple C# application that uploads a text file to
I have Vista with IIS7 . I want to create a simple Silverlight application
I want to create an application that using DLL modules that dynamically connects to
I have created a java application for Debian Linux. Now I want that that
I have this application that I want to support multi languages. I thought the
We have a server application that we want to restrict non-users from triggerring it
I have a .NET application that I want to use as a client to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.