Copied to clipboard

Flag this post as spam?

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


  • Alex 3 posts 83 karma points
    Nov 08, 2019 @ 16:07
    Alex
    0

    Get a specific contentType on Umbraco 8

    In Umbraco 7 I wrote like this

    ...
    IContentType dt = contentTypeService.GetContentType("nameCont");
    ...
    

    Now in Umbraco 8 which is the fastest method to get a specific contentType?

    Can anyone help me?

  • Thomas 212 posts 480 karma points c-trib
    Nov 13, 2019 @ 22:37
    Thomas
    0

    Hey,

    Can you use:

    IEnumerable<IPublishedContent> t = Umbraco.Content(1234).Descendants().Where(x => x.ContentType.Alias == "nameCont");
    
  • 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