Copied to clipboard

Flag this post as spam?

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


  • Umbracoraco 23 posts 153 karma points
    Jan 31, 2023 @ 07:16
    Umbracoraco
    0

    How to get content by route in Umbraco 10?

    How should I change this to achieve the same result in Umbraco 10? 
    
     public IPublishedContent GetContentByRoute(string route)
        {
            return Umbraco.Web.Composing.Current.UmbracoContext.Content.GetByRoute(route);
        }
    
  • Umbracoraco 23 posts 153 karma points
    Feb 01, 2023 @ 05:48
    Umbracoraco
    100

    Solved by injecting umbraco context!

Please Sign in or register to post replies

Write your reply to:

Draft