Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Simon Miller 13 posts 36 karma points
    May 13, 2013 @ 06:39
    Simon Miller
    0

    Custom routes with child pages

    Hi There,

    I'm wondering if anyone has a suggestion as to how to achieve this:

    I have a node of type Category. It has one property, a multi-node picker called 'products'. I am doing it this way because a product can be in multiple categories and are stored elsewhere in the Umbraco tree. 

    The Umbraco admin can make many of these categories:

    /gift-store
    /shits-and-pants
    etc.

    The URL structure I want it to be:

    /category-node-url/product-url

    Obviously as the products are not children of the category, the default routes do not work. If the category names were fixed, I could easily make a custom route for "category-name/{product-name}", however, the categories can be defined in the Umbraco back-end.

    Ideally I want to be able to create a custom route that worked something like this: "{CategoryNodeTypeAlias}/{product-name}" i.e. anything below a Category get's passed to a custom controller for processing.

    Any ideas?

    Cheers
    Simon 

  • Funka! 398 posts 661 karma points
    Jun 26, 2013 @ 01:09
    Funka!
    0

    Hi Simon,

    I know this reply is over a month old from your original question, but take a look at this thread which describes one way to do this using a custom NotFoundHandler. There are also other suggestions there about using an IIS Rewrite Rule, and in v6.1+ how you can implement your own "ContentFinder" which supposedly would allow you to do this.

    One thing I am coming to the realization/conclusion on, however, is that you want to avoid custom routes as they escape the entire umbraco pipeline and you won't be able to do anything umbraco-related if you try to go this route. (Pun intended.)

    Good luck to you! Sorry no one else was able to help you in a more timely manner but hopefully you got something figured out.

  • Funka! 398 posts 661 karma points
    Jun 26, 2013 @ 01:15
    Funka!
    0

    Sorry, I linked the wrong thread there in my previous reply. This is the one I was thinking of and had meant to link. (Although I think both are relevent?)

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies