Copied to clipboard

Flag this post as spam?

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


  • Martijn 5 posts 76 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 23 posts 291 karma points
    Oct 18, 2021 @ 11:09
    Corné Hoskam
    100

    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!

  • Martijn 5 posts 76 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