Copied to clipboard

Flag this post as spam?

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


  • Saif Obeidat 79 posts 296 karma points
    Mar 18, 2020 @ 07:19
    Saif Obeidat
    0

    How to add node ID to a node's URL dynamically

    Hello,

    Anyone knows how to implement something like the Umbraco Forums topics URLs.

    as you can see below, Umbraco Forum adds node ID as a prefix to the URL.

    enter image description here

    I've read before, that this can be done by UmbracoUrlName, where you can customize a URL, but I need it dynamically, without the need to edit a node each time.

  • Marc Goodson 2149 posts 14354 karma points MVP 9x c-trib
    Mar 22, 2020 @ 08:06
    Marc Goodson
    101

    Hi Saif

    You can plugin your own logic to how a Url is generated in Umbraco for a particular type of page, you can do this by creating a custom UrlProvider and ContentFinder, to specify the rules for generating the Url and then mapping that incoming Url to the content.

    But you can also customise the logic that generates a particular 'segment' of a url - by creating a custom UrlSegmentProvider... there is an example in the documentation of adding a 'product id sku' to the segment of the Url - see here:

    https://our.umbraco.com/Documentation/Reference/Routing/Request-Pipeline/outbound-pipeline#example

    That might be relevant to what you are trying to achieve.

    regards

    Marc

  • Saif Obeidat 79 posts 296 karma points
    Mar 22, 2020 @ 08:15
    Saif Obeidat
    0

    We have dealt with this issue by creating an UmbracoURLName property, and we've set an event on nodes creation, so we fill UmbracoURLName with the updated URL each time a node gets created. But I think your solutions makes more sense and reliable, we will check it and apply it. Thanks Marc!

  • Saif Obeidat 79 posts 296 karma points
    Mar 23, 2020 @ 13:03
    Saif Obeidat
    0

    This great documentation https://our.umbraco.com/Documentation/Reference/Routing/Request-Pipeline/outbound-pipeline#example helped us in generating a particular segment, Thanks Marc.

  • Mona 36 posts 106 karma points
    Jun 29, 2021 @ 11:47
    Mona
    0

    Dear Saif,

    I need assistance, I am facing an issue with secondary language, In my case English is working fine but secondary language Danish is not working as shown below. I've added domain from Culture and Hostnames. For English https://localhost:4865 (working fine), For Danish language https://localhost:4865/dk (getting following error) enter image description here

    English is working fine as default language enter image description here

    Danish is not working, getting 404 error as shown above enter image description here

    Plz assist

Please Sign in or register to post replies

Write your reply to:

Draft