Copied to clipboard

Flag this post as spam?

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


  • Martijn 7 posts 88 karma points
    Oct 18, 2021 @ 10:35
    Martijn
    0

    How to get the complete slug of an IPublishedContent item?

    I want to retreive the complete slug instead of the UrlSegment of an IPublishedContent item. How can I do this in Umbraco 9?

    Thanks.

  • Corné Hoskam 81 posts 588 karma points MVP 3x c-trib
    Oct 18, 2021 @ 11:09
    Corné Hoskam
    102

    Hi Martijn,

    Instead of using the .UrlSegment property on the IPublishedContent item, you can use the Url() extension method included in Umbraco by importing 'Umbraco.Extensions.FriendlyPublishedContentExtensions.Url'!

    Hope this helped!

  • Nurhak Kaya 56 posts 150 karma points MVP 3x c-trib
    Feb 08, 2022 @ 17:05
    Nurhak Kaya
    0

    Nice one Corné, thanks.

  • Martijn 7 posts 88 karma points
    Oct 18, 2021 @ 11:22
    Martijn
    0

    Yes, that's it, thanks!

  • 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