Copied to clipboard

Flag this post as spam?

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


  • z4kk 24 posts 83 karma points
    May 26, 2013 @ 08:25
    z4kk
    0

    Get Language of Content by Id

    Umbraco 6.1.0 beta 2

    How I can get Language of Content by Id?

    I try like that

    ApplicationContext.Services.ContentService.GetById(1070).Language

    But is allways return null

     

  • Andreas Iseli 150 posts 427 karma points
    May 27, 2013 @ 10:12
    Andreas Iseli
    0

    The property language still have the remark "Left internal until multilingual support is implemented.". I'm not sure if it is already implemented. Maybe it only has a value when hostnames are set?

  • Alex Skrypnyk 6132 posts 23951 karma points MVP 7x admin c-trib
    Apr 12, 2016 @ 15:25
    Alex Skrypnyk
    0

    Hi z4kk,

    I'm not sure about 6.1.0 beta 2 But now you can get language with this code:

    @using umbraco.cms.businesslogic.web;
    @{
     var firstDomainLanguage = Domain.GetDomainsById(Model.Content.AncestorOrSelf(1).Id)[0].Language;
    } 
    

    Thanks

Please Sign in or register to post replies

Write your reply to:

Draft