Copied to clipboard

Flag this post as spam?

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


  • z4kk 24 posts 83 karma points
    Mar 12, 2013 @ 09:29
    z4kk
    0

    Exclude Document form NiceUrl

    I want create document type for grouping content in backed (only for usability)

    For example:

    Content
    -- HomePage
       -- Catalog
          -- Collection 1
     -- Product 1
             -- Product n
          -- Collection 2
    .....

    Now if I call NiceUrl for Product 1, a have url like this: /HomePage/Catalog/Collection1/Product1.aspx

    How I can exclude Collection DocumentType form url, like thisL /HomePage/Catalog/Product1.aspx

    Thanks!

     

    Update:

    In sources I find class NiceUrlProvider, how and where I can declare my custom NiceUrlProvider?

  • Andreas Iseli 150 posts 427 karma points
    Mar 12, 2013 @ 14:19
    Andreas Iseli
    0

    There is an out of the box way to define a second URL where you may exlude the "Collection1". It is a simple config entry but I currently dunno where it is located :)

  • Neil Tootell 73 posts 118 karma points
    Mar 13, 2013 @ 17:41
    Neil Tootell
    0

    Hi z4kk (nice name!)

    Check out the "/config/UrlRewriting.config" file.

    You can set rules to do exactly what you want. There's extensive docs referenced in the file to get you started.

     

    Neil

  • z4kk 24 posts 83 karma points
    Mar 13, 2013 @ 18:00
    z4kk
    0

    Far as I know UrlRewriting.config not affected on NiceUrl. Or I'm mistaken?

  • Neil Tootell 73 posts 118 karma points
    Mar 13, 2013 @ 18:09
    Neil Tootell
    0

    Right, I see what you mean, but if ultimately it's about what people see on the public facing site then niceUrl's shouldn't matter.

    I suppose you could regular expression replace certain patterns on the niceUrl value as a string, then handle it's redirection using UrlRewites.

    Also, depending on the umbraco version you're on, you should remove the aspx extentions using the umbracoUseDirectoryUrls key in the root web.config - this may help with the regEx pattern matching.

    Neil

     

  • 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