Copied to clipboard

Flag this post as spam?

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


  • Phil Crowe 192 posts 256 karma points
    Oct 28, 2016 @ 09:46
    Phil Crowe
    0

    Get all domains for current culture

    In Umbraco 4 there use to be a method to obtain all the domains for the current culture GetCurrentDomains(). I can't find an equivalent way to do this in Umbraco 7.2+ API. Before I start writing a dirty new method to do this, is there a way in existence?

  • Alex Skrypnyk 5908 posts 22603 karma points MVP 4x admin c-trib
    Oct 28, 2016 @ 12:48
    Alex Skrypnyk
    100

    Hi Phil,

    Of course there is method in Umbraco 7 for getting all domains. Try this one:

    var domains = ApplicationContext.Current.Services.DomainService.GetAll(true).Where(x => x.LanguageIsoCode == System.Threading.Thread.CurrentThread.CurrentUICulture.TwoLetterISOLanguageName);
    

    Hope it will help.

    Thanks,

    Alex

  • 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