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 80 posts 587 karma points MVP 2x 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 53 posts 147 karma points MVP 2x 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!

Please Sign in or register to post replies

Write your reply to:

Draft