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

  • SEARCH
  • Home
  • 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 7459045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T13:56:17+00:00 2026-05-29T13:56:17+00:00

I have seen some posts about navigation and breadcrumbs but did not find the

  • 0

I have seen some posts about navigation and breadcrumbs but did not find the exaxt same problem. However if there is, please forgive and point me to it. Thank you.

My case :

Interests                   Profiles
|                       |
|_Interest Area 1               |-Profile Area 1
|   |                       |
|   |_Interest Area 1.1             |_List of Books
|       |                       |
|       |_List of Books                 |_Book Detail
|           |
|           |_Book Detail
|_Interest Area 2
    |
    |_List of Books
        |
        |_Book Detail

The hierarchy is stored in the database. The entry points Interests and Profiles are fixed. From there I don’t know what the children will be.

When there is no child left anymore, the books get retrieved based on the value of the last selected (sub)category.

I have two problems here:
1st: Creating the appropriate routes. The way I would like it is:

/books/{id}/{interestareaname}/{subinterestareaname}/{books}/{page}

where interestareaname is added for user friendly urls and keeps getting repeated as long you go down the hierarchy. The output would then be:
/books/1/project-management/prince2/books/1
this shows the prince2 books on paged listpage page 1.

But when there is only one level it the route contains only one interestareaname and thus becomes this:

/book/{id}/{interestareaname}/{books}/{page}

What I did to solve problem number 1:

    routes.MapRoute(
        "Details",
        "view/details/{id}/{booktitle}",
        new { controller = "book", action = "Details", id = "*", booktitle= "*"});

    routes.MapRoute(
        "interests",
        "books/{id}/{level1}/{level2}/{level3}/{page}",
        new { controller = "book", action = "books", level1 = "*", level2 = "*", level3 = "*", id = "0", page = UrlParameter.Optional }
    );
    routes.MapRoute(
        "profiles",
        "books/{id}/{level1}/{level2}/{level3}/{page}",
        new { controller = "book", action = "books", level1 = "*", level2 = "*", level3 = "*", id = "0", page = UrlParameter.Optional }
    );

I got to this by stating that a max level should be set. That is only because I didnt know how to make it more dynamic.

The problem now is to differentiate between the interests categories and the profile categories. I did that by creating a same route, but with different name and added the route name in the sitemap creation.

The 2nd problem I have is the sitemap and the breadcrumbs.
I use the MVCsitemapprovider and the DynamicNodes functionality.

With the sitemap I have a problem showing the details page. Because the books will appear both on profiles and on interests. And some books will appear in multiple interest areas or profiles.
In each case I would like to see the path I used to get to that book.

First I added the detail pages for each book to the sitemap, but that was crazy. And creates duplicate entries which are not handled very well by sitemaps.
Other option was to pass the routedata on the list page to the details page by querystring, but that looked awful and I have then to add logic to parse the querystring to mimic the breadcrumb, which will be hard, since I only have the ID then of the lowest level.

I have spent now many nights and I still can´t figure it out. If some one can help or point me to the right direction I am very grateful.

  • 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-05-29T13:56:19+00:00Added an answer on May 29, 2026 at 1:56 pm

    The only solution I found so far for myself is to actually create all possible routes, like:

            routes.MapRoute(
                "interest",
                "interest",
                new { controller = "books", action = "viainterest"},
                new { controller = "books", action = "viainterest" }
            );
    
            routes.MapRoute(
                "interest_1_details",
                "interest/{level1}/view/{id}/{booktitle}",
                new { controller = "books", action = "detailsviainterest_1, level1 = "*", id = 0, booktitle = "*" },
                new { controller = "books", action = "detailsviainterest_1" }
            );
    
            routes.MapRoute(
                           "interest2details",
                           "interest/{level1}/{level2}/view/{id}/{booktitle}",
                           new { controller = "books", action = "detailsviainterest_2", level1 = "*", level2 = "*", id = 0, booktitle = "*" },
                           new { controller = "books", action = "detailsviainterest_2" }
                       );
    
    
            routes.MapRoute(
                            "interestlevel_1",
                            "interest/{id}/{level1}",
                            new { controller = "books", action = "viainterestlevel_1, level1 = "*", id = 0 },
                            new { controller = "books", action = "viainterestlevel_1"}
                        );
    
            routes.MapRoute(
                           "interestlevel_2",
                           "interest/{id}/{level1}/{level2}",
                           new { controller = "books", action = "viainterestlevel_2", level1 = "*", level2 = "*", id = 0 },
                           new { controller = "books", action = "viainterestlevel_2}
                       );
            //and so on for level 3 and for profiles etc.
    

    In the DynamicNodeManager I add all the categories hierarchically and also add all the items. Now I get a decent breadcrumb all the way to the detail page. And since the paths (routedata and actions) for each detailpage are different, even a book that appears in several categories displays the correct breadcrumb.

    This solved my problem, but I am still thinking there should a better way. The problem with the current solution is that the tree will grow huge because of the detail items that are added to the nodecollection as well. The other downside is that the tree is generated at application start. Thus adding a new book, does not create a node, until I reset the web application.

    So if there are other suggestions I am happy to see them. For now I can continue with the content, which it is all about in the end.

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

Sidebar

Related Questions

So I have seen some other posts similar, but not quite answering what I
All right, I've seen some posts asking almost the same thing but the points
I have seen many posts about when to use ViewBag/ViewData vs ViewModel but i
i have seen some hand rolled solutions but does jquery out of the box
I have seen other posts on this site with answers, but I think I
I've seen some other posts on this, but it appears that when i do
I have seen this on some posts: $num = 5; if(((int)$num) < 4){ ...}
I have seen umpteen posts talking about working with pop window using window handle.
I've seen several posts here on SO about loading XML documents from some data
I have seen many posts about using the clock() function to determine the amount

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.