Copied to clipboard

Flag this post as spam?

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


  • Simone Chiaretta 132 posts 529 karma points c-trib
    Dec 07, 2016 @ 17:40
    Simone Chiaretta
    0

    UrlSegmentProvider giving "This document is published but its url would collide with content" error

    For a specific content type I want to generate a url that is made of also part of property of node.

    Specifically I want a blog post to be /archive/yyyy/mm/dd/title instead of the default url /archive/title.

    I did it a while ago, on Umbraco 7.3, and to achieve this I made custom UrlSegmentProvider that was returning a new segment yyyy/mm/dd/title (basically adding 3 new segments).

    Now I migrated to 7.5 and when I publish a post I get the following test as Link to Document: This document is published but its url would collide with content (unknown).

    enter image description here

    The url is not colliding with anything in the site at the moment. Also visible from the (unknown) instead of the node id it collides to.

    Is this a bug introduced in Umbraco? Or a UrlSegmentProvider should not add "segments"?

  • Stephen 767 posts 2271 karma points c-trib
    Dec 07, 2016 @ 17:43
    Stephen
    0

    A url segment provider should not add segments, just provide a single segment. For what you are doing you need to write a UrlProvider which provides the entire url for a content item.

  • Simone Chiaretta 132 posts 529 karma points c-trib
    Dec 07, 2016 @ 17:57
    Simone Chiaretta
    0

    Thx. Maybe there should be a different way a giving the error. (unknown) is kind of confusing.

    Maybe checking the string returned from the GetUrlSegment method and verify if it contains / and raise exception somewhere.

    I think the point where the check should happen is in the Umbraco.Core.Strings.ContentBaseExtensions.GetUrlSegment method.

  • Jeroen Breuer 4861 posts 12139 karma points MVP 3x admin c-trib
    Dec 07, 2016 @ 19:54
  • Simone Chiaretta 132 posts 529 karma points c-trib
    Dec 08, 2016 @ 20:48
    Simone Chiaretta
    0

    Hi, I was trying your code, but it doesn't handle requests for absolute urls.

    Is there a way to just add the simple yyyy/mm/dd without rewriting the full urlprovider that handles all possible modes (absolute, relative, auto)?

  • Damiaan 439 posts 1293 karma points MVP 4x c-trib
    Dec 07, 2016 @ 22:04
    Damiaan
    0

    Like mentioned by the others, a urlProvider is what you really need (and a contentfinder to find it back).

    And people will shoot me for this, but I still like the "date folders" concept for blogs when you need overview pages per year, month, ... I know, this rules out the listview, but content editors know where to look for there articles without searching.

  • Simone Chiaretta 132 posts 529 karma points c-trib
    Dec 08, 2016 @ 08:55
    Simone Chiaretta
    0

    I know I can use the UrlProvider + ContentFinder.. actually I did it already... :)

    The beauty of using the segment provider is that you didn't need to mess with Content Finders :)

    @Damiaan... I know... for the big project I went that approach, but I needed to keep the same url for the migration of my blog, and since articulate puts everything under /archive/ I just needed to add the date in the url.

  • MrFlo 149 posts 392 karma points
    Apr 20, 2017 @ 11:16
    MrFlo
    0

    @Stephen I got the same error since upgrading from 7.5.6 to 7.5.13 and I am using a custom UrlProvider that wasn't triggering this message before.

    Update: There is now issue tracker: http://issues.umbraco.org/issue/U4-9442#tab=Comments

  • Jeroen Breuer 4861 posts 12139 karma points MVP 3x admin c-trib
    Jun 02, 2017 @ 08:37
    Jeroen Breuer
    0

    If you're getting the "url would collide with content" error you could try the Url Preview package: https://our.umbraco.org/projects/backoffice-extensions/url-preview/

    It will show the URLs instead of the error.

    Jeroen

Please Sign in or register to post replies

Write your reply to:

Draft